Panel data with binary dependent variable in R

Is it possible to do regressions in R using a panel dataset with a binary dependent variable? I am familiar with using glm for logit and probit and plm for panel data, but I'm not sure how to combine them. Are there any existing code examples?

Thanks.

EDIT

It would also be useful if I could figure out how to extract the matrix that plm () uses when it performs regression. For example, you can use plm to perform fixed effects, or you can create a matrix with the corresponding dummy variables and then run it through glm (). In this case, however, the creation of the mannequins themselves is annoying, and it would be easier if plm did it for you.

Aviila

+4
source share
3 answers
model.frame(plmmodel) 

will provide you with a data frame that plm actually uses to install the model (i.e. after deleting the list, if you have NA, etc.).

I do not think that plm implemented functions for evaluating models with binary results, but I could be wrong. See the reference guide at: http://cran.r-project.org/web/packages/plm/index.html

If I am right, this may mean that you cannot β€œcombine the two” without the significant work of expanding the functions provided by plm.

+1
source

The pglm package may be what you need.

http://cran.r-project.org/web/packages/pglm/pglm.pdf

This package offers some features of glm-like models for panel data.

+5
source

Perhaps the lme4 package is what you are looking for. It seems that you can run generalized regressions with fixed effects using comme glme. But you should be aware that panel data with a binary dependent variable is different from ordinary linear models.

This site may be useful.

Regards, Manuel

+1
source

Source: https://habr.com/ru/post/1309331/


All Articles