Stata allows for fixed effects and random effects specification of the logistic regression through the xtlogit fe and xtlogit re commands accordingly. I was wondering what are the equivalent commands for these specifications in R.
The only similar specification I am aware of is the mixed effects logistic regression
> mymixedlogit <- glmer(y ~ x1 + x2 + x3 + (1 | x4), data = d, family = binomial)
but I am not sure whether this maps to any of the aforementioned commands.
x4is coded as a factor variable R will expand it as a set of dummy variables, which is equivalent to the fixed effects models. – Andy W Apr 22 '14 at 00:41(1 | x4)seems to be linked with the random effects model which leads to the mixed effects logistic regression link. – georgia2004 Apr 22 '14 at 00:57clogit()– ndoogan Apr 22 '14 at 00:57(1|x4)is associated with a random intercept for thex4grouping variable. Note with generalized linear models it is a bit more complicated than with OLS - you may not have any variation within the group for the outcome and those groups will need to be dropped for the fixed effects models. – Andy W Apr 22 '14 at 02:01