proc import datafile="C:/research/McNemar/mcnemar.csv" out=mcnemar dbms=csv replace;
run;
/* Method 1: ANCOVA */
proc mixed data=mcnemar;
class group;
model after = before group / s;
* repeated / group=group;
run;
Cov Parm Estimate
Residual 2.9548
Fit Statistics
-2 Res Log Likelihood 788.6
AIC (smaller is better) 790.6
AICC (smaller is better) 790.6
BIC (smaller is better) 793.9
Solution for Fixed Effects
Standard
Effect group Estimate Error DF t Value Pr > |t|
Intercept 3.3828 0.5799 197 5.83 <.0001
before 0.7123 0.05526 197 12.89 <.0001
group 1 -0.6364 0.2433 197 -2.62 0.0096
group 2 0 . . . .
Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
before 1 197 166.16 <.0001
group 1 197 6.84 0.0096
/* GEE와 LMM을 위한 데이타 변형 */
proc sql;
create table mcnemar_long as
select group, id, 1 as period, before as y from mcnemar union
select group, id, 2 as period, after as y from mcnemar
;quit;
/* Method 2: GEE */
proc genmod data=mcnemar_long;
class group period id;
model y = group | period / type3;
repeated subject=id / type=cs;
run;
Exchangeable Working
Correlation
Correlation 0.6824097989
Chi-
Source DF Square Pr > ChiSq
group 1 2.76 0.0968
period 1 2.62 0.1058
group*period 1 4.94 0.0263
/* Method 3: Repeated Measure ANOVA */
proc mixed data=mcnemar_long;
class group period id;
model y = group | period;
random id;
run;
Cov Parm Estimate
id 3.4813
Residual 1.6722
Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
group 1 198 2.77 0.0978
period 1 198 2.62 0.1068
group*period 1 198 5.01 0.0263