0

I am using glmer from the lme4 package in R to conduct a multivariate analysis.

My response variable is define as

rate <- cbind(A, B)

where A is the count of positive cases in a cohort and B is the total count of the cohort minus A.

The formula I am using is

glmer(rate ~ C + D + E + F + G + (1 | Z), family=poisson())

where C - F are 1 or 0, G is a count and Z is a factor with 6 levels.

When I run this model, I get the error updateXwts: dimension mismatch, but as far as I am aware, glmer supports multivariate analysis.

Any ideas on how I can solve this?

JakeCowton
  • 1,374
  • 5
  • 15
  • 35
  • 2
    I think you should be using the binomial family for this type of model; poisson isn't appropriate. – David_B Jun 21 '16 at 10:26
  • Okay, that fixes it. Can you elaborate or link me something that explains why a binomial distribution is better for this? `A` is definitely a Poisson distribution, so I sub-consciously made the assumption that combining `A` and `B` would also be Poisson. – JakeCowton Jun 21 '16 at 10:29
  • It's because you have a fixed number of trials; a Poisson distribution has no upper limit. – David_B Jun 21 '16 at 10:51
  • Thanks again for your help with this. I'm now scaling this problem up to use more random effects using MCMCglmm. Think you could lend another helping hand? https://stackoverflow.com/questions/38055240/r-alleged-missing-values-when-no-values-are-actually-missing-for-mcmcglmm – JakeCowton Jun 30 '16 at 15:59

0 Answers0