Chapter 15, Section 15.5
Random Effects Log-Linear Regression Model
data seizure;
infile 'epilepsy.dat';
input id trt age y0 y1 y2 y3 y4;
y=y0; visit=0; output;
y=y1; visit=1; output;
y=y2; visit=2; output;
y=y3; visit=3; output;
y=y4; visit=4; output;
drop y0-y4;
proc sort;
by id visit;
data seizure;
set seizure;
****************************************************************************;
* Remove Subject ID 49, a potential outlier, from the analysis *;
****************************************************************************;
if (id ne 49);
if visit=0 then do;
time=0;
ltime=log(8);
end;
else do;
time=1;
ltime=log(2);
end;
title1 PQL Estimation of Mixed Effects Log-linear Regression Model (Random Intercept and Slope);
title2 Analysis Excluding Patient 49 (Potential Outlier);
title3 Clinical Trial of Epileptic Patients;
proc glimmix method=rspl;
class id;
model y = time trt trt*time / dist=poisson link=log offset=ltime solution;
random intercept time / subject=id type=un g;
run;
<Selected Output>
title1 MQL Estimation of Mixed Effects Log-linear Regression Model (Random Intercept and Slope);
title2 Analysis Excluding Patient 49 (Potential Outlier);
title3 Clinical Trial of Epileptic Patients;
proc glimmix method=rmpl empirical=classical;
class id;
model y = time trt trt*time / dist=poisson link=log offset=ltime;
random intercept time / subject=id type=un g;
run;
<Selected Output>
Marginal Log-Linear Regression Model
title1 GEE Estimation of Marginal Log-linear Regression Model (Random Intercept and Slope);
title2 Analysis Excluding Patient 49 (Potential Outlier);
title3 Clinical Trial of Epileptic Patients;
proc genmod;
class id visit;
model y = time trt trt*time / dist=poisson link=log offset=ltime solution;
repeated subject=id / withinsubject=visit type=un;
run;
<Selected Output>
Random Effects Logistic Regression Model
data amen;
infile 'amenorrhea.dat';
input id trt time y;
ctime=time;
time2=time*time;
title1 PQL estimation of Random Effects Logistic Regression Model for Odds of Amenorrhea;
title2 Clinical Trial of Contracepting Women;
proc glimmix method=rspl noclprint;
nloptions maxiter=50;
class id;
model y = time time2 trt*time trt*time2 / dist=binomial link=logit solution;
random intercept / subject=id g;
contrast '2 df Test of Trt X Time Interaction' trt*time 1, trt*time2 1 / chisq;
run;
<Selected Output>
title1 MQL estimation of Random Effects Logistic Regression Model for Odds of Amenorrhea;
title2 Clinical Trial of Contracepting Women;
proc glimmix method=rmpl noclprint empirical=classical;
nloptions maxiter=50;
class id;
model y = time time2 trt*time trt*time2 / dist=binomial link=logit solution;
random intercept / subject=id g;
contrast '2 df Test of Trt X Time Interaction' trt*time 1, trt*time2 1 / chisq;
run;
<Selected Output>