Displaying 1 result from an estimated 1 matches for "educlin".
Did you mean:
dublin
2007 Dec 07
2
Same regression per sub-group: apply?
...gression
analyses, for each country separately. The question is, how to do
this nicely (thus without repeating the same syntax with another
`subset' argument).
I thought of the following:
model.per.country <- tapply(data, data$COUNTRY, function(x) glm
(dependent.var ~ FEMALE + AGE + EDUCLIN + (), family=binomial,
data=capital))
But this does not work. What goes wrong, I think, is that the
dependent variable is clustered according to `Country', but not so
for the predictors. The error message I received:
Error in tapply(dat, dat$COUNTRY, function(x) glm(participate ~
FEMA...