I am getting a repeated error when I try to run a logistic regression in R
2.8.1
>(glm(prop1~x1,data=glm1,family=binomial("logit"),weights=nt1))
Error in model.frame.default(formula = prop1 ~ x1, data = glm1, weights =
nt1, :
invalid type (list) for variable 'x1'
x1 is multistate categorical (3 categories). 2 of the categories have 12
observation, one has 9. Is this what it is objecting to?
Do I have to have equal numbers of observations of all categories in R?
nt1 is the total number of events for which p1 is the success proportion,
each is linked with a category, vis..
> list(glm1)
[[1]]
V1 V1 V1
1 1.00000000 cc 10
2 0.73333333 cc 15
3 0.04761905 cc 21
etc....
Probably a newbie error either in data setup, but assistacne would be
appreciated.
Ned
--
View this message in context:
http://www.nabble.com/logistic-regression---unequal-groups-in-R-tp22215299p22215299.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.