[R] logistic regression R and Stata – grouping variable

Lambert Bruno bruno.lambert at uantwerpen.be
Tue May 26 11:33:56 CEST 2015


I mostly use Stata 13 for my regression analysis. I want to conduct a logistic regression on a proportion/number of success. Because I receive errors in Stata I did not expect nor understand (if there are Stata experts who want to know more about the problems I face and can potentially help me solve them, I would be glad to give more details), I want to repeat the analysis in R. In Stata I would use the command: xtlogit DEP_PROP INDEP_A INDEP_B INDEP_C, i(ID). ID is the identifier for each subject. There are eight lines with data for each subject because there are three within factors (INDEP_A, B, C) with two levels each (0 and 1). I can repeat this analysis in R by using the command: glm(DEP_SUC ~ INDEP_A + INDEP_B + INDEP_C, family = “binomial”). DEP_SUC is here a table with the successes and misses per row. Again, there are eight rows for each subject. But while I know how to group these lines in Stata by using the option i(ID ), I do not know what to do in R. I have search for more information about the i() command, but did not find any usefull information.

So, to summarize: I want to find out how three variables (binary) influence a proportion and use logistic regression. In Stata I can group multiple lines per subject using the i( ) command in logistic regression. What is the equivalent in R?

Thank you in advance!

	[[alternative HTML version deleted]]

More information about the R-help mailing list