4.6. A Hybrid Approach

As we saw with linear models and logistic models, it's possible to combine the fixed effects and random effects approaches to get some of the virtues of each. As before, the first step is to calculate the mean of each time-varying predictor variable for each individual, and then calculate the deviations from those means:

PROC SORT DATA=patents2;
   BY id;
PROC MEANS DATA=patents2 NWAY NOPRINT;
   CLASS id;
   VAR rd_0-rd_5;
   OUTPUT OUT=means MEAN=mrd_0 mrd_1 mrd_2 mrd_3 mrd_4 mrd_5;
DATA patcomb;
   MERGE patents2 means;
   BY id;
   drd_0=rd_0-mrd_0;
   drd_1=rd_1-mrd_1;
   drd_2=rd_2-mrd_2;
   drd_3=rd_3-mrd_3;
   drd_4=rd_4-mrd_4;
   drd_5=rd_5-mrd_5;
RUN;

The next step is to run a regression model with both the deviations and the means as predictor ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.