9

I know this question might have been around before like in this SO thread, but maybe (hopefully) its answer has changed over time.

  • Is there any package in R or an outline how to do panel regressions with a discrete dependent variable?
  • Is there any other open source package that does it and that would help coding something in R?
kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
hans0l0
  • 2,065
  • 4
  • 25
  • 31

4 Answers4

4

For "fixed effects" logit regression as understood in econometrics (also called Chamberlain's conditional logit), "clogit" in the "survival" package does the job.

Julian Schuessler
  • 2,025
  • 11
  • 16
  • Any confirmation that that is what this package does? From the examples, mclogit seems do do multinomial logit, not binary logit. I can't see a difference between mclogit and clogit. – RegressForward Jul 09 '16 at 17:19
  • 1
    @RegressForward Yes, that seems to be the case. I've edited my answer. Clogit in survival definitely does the job. – Julian Schuessler Jul 20 '16 at 17:32
1

What is wrong with using plm or lme4 (another link)? Particularly the glmer function?

mpiktas
  • 33,140
  • 5
  • 82
  • 138
Patrick McCann
  • 1,330
  • 7
  • 12
  • plm as far as I know does not have functions for fitting discrete data models. `lme4` is a good suggestion, but should be used with care, since it assumes that all the independent variables are exogenous, which is not always the case for panel data in econometrics. – mpiktas May 30 '11 at 07:41
1

pglm is now available and for e.g. conditional logit there is a closed form estimator that should be straightforward to implement.

Alex
  • 1,047
  • 7
  • 12
  • Just to note, this package does not support a fixed effects logistic model. See https://stats.stackexchange.com/questions/146434/why-pglm-fails-for-within-model – CoderGuy123 Feb 04 '19 at 07:16
0

If your dependent variable is only binary, you could try out the package "bife".

Their package description is:

"Estimates fixed effects binary choice models (logit and probit) with potentially many individual fixed effects and computes average partial effects. Incidental parameter bias can be reduced with an asymptotic bias correction proposed by Fernandez-Val (2009)"

Poza
  • 23
  • 4