I have six dependent variables (count data) and several independent variables, I see that in a MMR the script goes like this:
my.model <- lm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn)
But, since my data are counts, I want to use a generalized linear model and I tried this:
my.model <- glm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn, family="poisson")
And appears this error message:
Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, :
(subscript) logical subscript too long`
Can anyone explain me this error message or a way to solve my problem?
lmdoes when you give it a matrix? – conjugateprior Apr 17 '12 at 22:02lm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn)I must
– Juan Apr 18 '12 at 15:22lm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn)I must use the manova() command like this:
summary(manova(my.model))to do a multivariate analysis of variance and see the significance of each independent variable. That is the final target.
– Juan Apr 18 '12 at 16:27summarywill give them to you for each DV. – conjugateprior Apr 18 '12 at 17:20loglinb2andloglinb3functions) where running separate glms as in the accepted answer may be erroneous. – dcsuka Dec 29 '22 at 20:15