Chapter 9, Section 9.6
Linear Fixed Effects Model
data fev;
infile 'fev1.dat';
input id ht age baseht baseage logfev1;
if (id ne 197);
***********************************************;
* Removing outlier: Subject ID = 197 *;
***********************************************;
y=logfev1 - 2*(log(ht));
logbht=log(baseht);
title1 Fixed Effects Model for log{FEV1/(Ht**2)};
title2 Six Cities Study;
proc glm;
class id;
model y = id age / noint solution;
run;
title1 Fixed Effects Model (using Absorb Statement) for log{FEV1/(Ht**2)};
title2 Six Cities Study;
proc glm;
absorb id;
model y = age / solution;
run;
<Selected Output>
Linear Mixed Effects Model (Random Intercept)
title1 Mixed Effects Model for log{FEV1/(Ht**2)} with Random Intercept;
title2 Six Cities Study;
proc mixed method=reml noclprint covtest;
class id;
model y = age / s chisq;
random intercept / subject=id g;
run;
<Selected Output>
Linear Mixed Effects Model (Random Intercept): Decomposing Between- and Within-Subject Efeects
***********************************************;
* Create mean-centered age variable *;
***********************************************;
proc mean data=fev nway;
class id;
var age;
output out=fevm mean=mage;
proc sort data=fev;
by id;
proc sort data=fevm;
by id;
data all;
merge fev fevm;
by id;
cage=age-mage;
run;
title1 Mixed Effects Model for log(FEV1) with Random Intercept;
title2 Decomposing Between- and Within-Subject Effects;
proc mixed method=reml noclprint covtest;
class id;
model y = cage mage / s chisq;
random intercept / subject=id g;
run;
<Selected Output>