BookmarkSubscribeRSS Feed
pablas29
Fluorite | Level 6

I have panel data and I ran the below SAS code to get the coefficients.

PROC GLIMMIX DATA=data1 ;
CLASS pid year;
MODEL employed(event='Yes')= age / SOLUTION ;
RANDOM INTERCEPT/ SUBJECT = pid ;
RUN;

PROC PANEL DATA=data1;
MODEL employed = age /RANone ;
ID pid year;
RUN;

I tried doing a similar thing using Stata as below but the results between SAS and Stata output are different.

xtset pid year
xtlogit employed age


I am not sure which is the correct result? Also, do I need to add any option when running similar code on unbalanced panel data?

Balanced data panel example:

pid year age employed
1 2001 33 yes
1 2002 34 no
1 2003 35 yes
2 2001 23 yes
2 2002 24 yes
2 2003 25 yes

 

Cross-posted.

1 REPLY 1
StatDave
SAS Super FREQ

First, since your response is binary, you should specify DIST=BINARY or BINOMIAL in the MODEL statement in GLIMMIX. However, there are many ways to analyze repeated measures/panel data like this. The random effects model is one way. Another is the Generalized Estimating Equations (GEE) model, available in PROC GEE or PROC GENMOD. There is also the conditional logistic model available in PROC LOGISTIC with the STRATA statement. See this note regarding types of logistic models. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 663 views
  • 1 like
  • 2 in conversation