/* Polygraph data using 3 judges to score the sessions and 4 */ /* different tests to evaluate judges' scores. Tests 3 and 4 */ /* are two-stage procedures that should produce fewer "No Opinions" */ proc format; value respfmt 1='Deceptive' 2='Truthful' 3='No Opinion'; data polygraph; input J1T1 J1T2 J1T3 J1T4 J2T1 J2T2 J2T3 J2T4 J3T1 J3T2 J3T3 J3T4 Count; format J1T1 J1T2 J1T3 J1T4 J2T1 J2T2 J2T3 J2T4 J3T1 J3T2 J3T3 J3T4 respfmt.; datalines; 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 2 1 1 1 2 1 1 1 3 6 1 1 1 3 1 1 2 3 2 1 1 3 4 1 1 3 1 1 2 3 1 1 1 3 1 2 1 1 3 3 1 1 3 1 1 1 3 3 3 1 3 2 3 1 3 3 3 3 1 3 3 1 2 2 2 2 2 2 2 2 2 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 21 2 2 2 3 2 2 2 3 2 2 2 2 5 2 2 1 3 2 2 2 3 2 2 2 2 2 3 1 1 1 1 1 1 1 3 1 1 1 2 3 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 3 3 3 1 3 1 3 1 2 3 2 2 2 3 2 2 1 3 3 2 1 2 3 3 2 2 3 3 2 2 3 3 2 2 14 3 3 2 3 3 3 2 3 3 3 2 2 5 3 3 3 3 3 3 3 3 3 3 3 3 7 3 3 2 3 3 3 2 1 3 1 2 2 1 run; *I use linear models here; data mh1; set polygraph; if j1t1<3 and j1t3<3; proc freq data=mh1; weight Count; table j1t1*j1t3; run; /* Two-by-two table analysis */ proc catmod data=mh1; weight count; response marginals; /* _Response_ acknowledges that some "effects" we want to test */ /* are actually linear combinations of response functions--it */ /* sets up appropriate design columns to test these effects */ model j1t1*j1t3=_response_/design; repeated test 2/_response_=test; run; *Two-by-two analysis with no marginal homogeneity; data mh1a; set polygraph; if j1t1>1 and j1t3>1; proc freq data=mh1; weight Count; table j1t1*j1t3; run; /* Two-by-two table analysis */ proc catmod data=mh1; weight count; response marginals; model j1t1*j1t3=_response_/design; repeated test 2/_response_=test; run; /*Three-by-three frequency table */ data mh2; set polygraph; proc freq data=mh2; Weight count; table j1t1*j1t3; run; /* Three-by-three analysis */ proc catmod data=mh2; weight Count; response marginals; model j1t1*j1t3=_response_; repeated test 2; run; /* 3 judges--this won't work*/ proc catmod data=mh2; weight Count; response marginals; model j1t1*j2t1*j3t1=_response_; repeated judge 3; run; /* 3 judges. Run the R code to generate the necessary data sets */ data mh3; infile "/home/grego1/STAT 770/3tothe3.txt"; input j1t1 j2t1 j3t1 count; run; proc catmod data=mh3; weight Count; response marginals; model j1t1*j2t1*j3t1=_response_/design freq; repeated judge 3/_response_=judge; run; /* 4 tests */ data mh4; infile '/home/grego1/STAT 770/3tothe4.txt'; input j1t1 j1t2 j1t3 j1t4 count; run; proc catmod data=mh4; weight Count; response marginals; model j1t1*j1t2*j1t3*j1t4=_response_; repeated test 4/_response_=test; run; /* 3 judges, 4 tests */ data mh5; infile "/home/grego1/STAT 770/3tothe12.txt"; input j1t1 j1t2 j1t3 j1t4 j2t1 j2t2 j2t3 j2t4 j3t1 j3t2 j3t3 j3t4 count; run; /* Overall tests of effects and design matrix is correct, but parameters */ /* 3 through 24 are mis-assigned */ proc catmod data=mh5; weight Count; response marginals; model j1t1*j1t2*j1t3*j1t4*j2t1*j2t2*j2t3*j2t4*j3t1*j3t2*j3t3*j3t4=_response_/design; repeated test 4, judge 3/_response_=test judge test*judge; run;