preserve. set printback=on. * DYADIC DATA ANALYSIS: TYPES OF VARIABLES * VarType.sps * * Valentim R. Alferes (University of Coimbra, Portugal) * March 2008. * VarType.sps is an SPSS syntax file that determines the type of dyadic * variables: * - Between-dyads variables * - Within-dyads variables * - Mixed variables * [see: Kenny et al. (2006, pp. 7-9) and/or * http://davidakenny.net/dyad.htm#Top4]. * The syntax runs automatically from the SPSS syntax window. The only * prerequisite for the user is to have an SPSS active file in dyadic format, * with no missing data for the dyadic variable under analysis. In the * beginning of the syntax the user must specify the names of the column * variables corresponding to Member 1 and Member 2 scores. * Example data: Kenny, Kashy & Cook (2006, p. 33, Table 2.1). data list free/dyad var1 var2. begin data. 1 8 6 2 5 3 3 7 2 4 8 5 5 8 7 6 5 6 7 3 4 8 8 9 9 6 7 10 2 3 end data. *\beginning of the program. set printback=on. /* User Specifications /* * Replace var1 with your variable name for member 1 scores. compute x.1 = var1. * Replace var2 with your variable name for member 2 scores. compute x.2 = var2. set printback=off. set tlook none tfit both tvars labels tnumbers labels. /* Analysis and determination of the dyadic variable type /* compute sumvars = x.1 + x.2. compute difvars= x.1 - x.2. variable labels x.1 "Member 1 Scores" x.2 "Member 2 Scores" sumvars "Sum of Scores" difvars"Difference of Scores". descriptives variables=x.1 x.2 sumvars difvars /statistics=mean sum stddev variance min max/save. correlations/variables=x.1 x.2/print=twotail sig/statistics xprod. igraph/viewname='Scatterplot'/x1=var(zx.1)/y=var(zx.2)/fitline method=origin linear line=total/scatter coincident=none. compute zz=Zx.1*Zx.2. compute k=1. aggregate/outfile=*/break=k/zzsum=sum(zz)/n=n. compute r=zzsum/(n-1). compute vartype=rnd(r*10**10)/10**10. recode vartype (1=1)(-1=2)(else=3). variable labels vartype "Dyadic variable is a". value labels vartype '1' "Between Dyads Variable" '2' "Within Dyads Variable" '3' "Mixed Variable". oms/select tables /if commands=["Summarize"] subtypes=["Case Processing Summary"]/destination viewer=no. summarize/tables=vartype/format=list nocasenum nototal /title='Variable Type Test'/footnote 'If this test and your'+ ' theoretical definition donīt agree, check your data.'/cells=none. set printback=on. */end of the program. restore. ***************************************************************************** * Reference: * * Kenny, D. A., Kashy, D. A., & Cook, W. L. (2006). Dyadic data analysis. * New York: Guilford Press. ****************************************************************************.