preserve.
set printback=on.
* MEASUREMENT OF NONINDEPENDENCE IN STANDARD DYADIC DESIGNS
Inter2.sps - Categorical measures / Tabulated data.
* Example data: Kenny, Kashy & Cook (2006, p. 41, Table 2.4).
data list free/Member1 Member2 count.
begin data.
1 1 106
1 2 10
1 3 4
2 1 22
2 2 28
2 3 10
3 1 2
3 2 12
3 3 6
end data.
*\beginning of the program.
set printback=off.
oms/select tables/if commands=["crosstabs"]
subtypes=["case processing summary"]/destination viewer=no.
set printback=on.
/* Distinguishable members /*
set printback=off.
* Calculating kappa.
weight off.
sort cases by member1(a) member2(a).
weight by count.
crosstabs/tables=member1 by member2/statistic=kappa.
set printback=on.
/*Indistinguishable members /*
set printback=off.
* Averaging off-diagonal cells.
save outfile=file1.
sort cases by member2(a) member1(a).
compute count2=count.
execute.
delete variables member1 member2 count.
match files/file=*/file=file1.
compute meancount=mean(count2,count).
* Calculating kappa.
weight by meancount.
crosstabs/tables=member1 by member2/statistic=kappa/count asis.
delete variables count2 meancount.
save outfile=file0.sav.
set printback=on.
*/end of the program.
restore.
*********************************************************************
* Reference:
*
* Alferes, V. R., & Kenny, D. A. (in press). SPSS programs for the
* measurement of nonindependence in standard dyadic designs.
* Behavior Research Methods [Submitted: 22-May-2008; Accepted
* for publication: 16-Jul-2008].
********************************************************************.