3.6. A Hybrid Model

In chapter 2, we saw how linear models with fixed and random effects could be combined into a single model by decomposing the time-varying predictors into within-person and between-person components, and by including both components in a random effects model. We can do the same for the logistic regression model, but, unfortunately, things don't work out quite so neatly.

As before, the first step is to calculate person-specific means and deviations from those means for the time-varying predictors:

PROC SORT DATA=teenyrs5;
   BY id;
   CLASS id;
   VAR  mother spouse inschool hours;
   OUTPUT OUT=means MEAN=mmother mspouse mschool mhours;

The CLASS statement tells PROC MEANS to calculate the means ...

Get Fixed Effects Regression Methods for Longitudinal Data Using SAS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.