preserve. set printback=on. * MEASUREMENT OF NONINDEPENDENCE IN STANDARD DYADIC DESIGNS Inter1.sps - Interval measures. * Example data: Kenny, Kashy & Cook (2006, p. 33, Table 2.1). data list free/dyad x.1 x.2. 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 /* * Enter alpha for confidence intervals (by default, alpha=.05). compute alpha=.05. set printback=off. set ovars labels onumbers values tvars labels tnumbers values. save outfile='%temp%\file1'. /* Part 1 - Distinguishable members: Pearson correlation (r)/* * Calculating and testing r. descriptives variables=x.1 x.2/save. compute zz=Zx.1*Zx.2. compute k=1. aggregate/outfile=*/break=k/zzsum=sum(zz)/alpha=max(alpha)/n=n. compute r=zzsum/(n-1). compute df=n-2. compute t=(r*sqr(df))/(sqr(1-r**2)). compute p=2*(1-cdf.t(abs(t),df)). * Confidence interval for r. compute z=(ln(1+r)-ln(1-r))/2. compute zlow=z-idf.normal((1-alpha/2),0,1)/sqr(n-3). compute zupp=z+idf.normal((1-alpha/2),0,1)/sqr(n-3). compute rlow=(exp(2*zlow)-1)/(exp(2*zlow)+1). compute rupp=(exp(2*zupp)-1)/(exp(2*zupp)+1). * Output management. formats all(f8.2) n df(f8.0) p(f8.3). variable labels p"Sig. (2-tailed)" t"t Value" rlow"CI of r \n Lower Bound" rupp"CI of r \n Upper Bound". oms/select tables/if commands=["variables to cases"] subtypes=["generated variables"]/destination viewer=no. oms/select tables/if commands=["variables to cases"] subtypes=["processing statistics"]/destination viewer=no. oms/select tables/if commands=["unianova"] subtypes=["between subjects factors"]/destination viewer=no. oms/select tables/if commands=["unianova"] subtypes =["test of between subjects fixed effects"]/destination viewer=no. oms/select tables/if commands=["summarize"] subtypes=["case processing summary"]/destination viewer=no. summarize/tables=n r t df p rlow rupp/format=list nocasenum nototal /title='Distinguishable Members: \n Pearson Correlation, t Test,' +' and Confidence Interval'/cells=none. /* Part 2 - Indistinguishable members: Intraclass correlation (ICC)/* * Restructure file. get file='%temp%\file1'. varstocases/make dv x.1 x.2/index=person. * Calculating and testing ICC. unianova dv by dyad/design=dyad/outfile=effect('%temp%\file2'). get file='%temp%\file2'. if(source_='S2') msb=ms. if(source_='Error') msw=ms. if(source_='S2') df1=df. if(source_='Error') df2=df. compute k=1. aggregate/outfile=*/break=k/msb=max(msb)/msw=max(msw) /df1=max(df1)/df2=max(df2). compute icc=(msb-msw)/(msb+msw). if (msb>=msw) f=msb/msw. if (msb=msw) p=2*(1-cdf.f(f,df1,df2)). if (msb