I was fitting a linear mixed effects model when I realised that my outcome variable CORRECTNESS is actually the proportion of correct responses, and so is bounded between 0 and 1, and there is I suppose a finite number of possible values it can take in my data.
It was therefore suggested to me that I use a generalized linear model with a poisson distribution. When I tried to re-run my null model with a poisson distribution I get two warnings and an error message.
My data looks like this (CORRECTNESS is a numeric variable, and ID is a factor):
CORRECTNESS <- c(0.625, 0.375, 0.5, 1,1,0.875)
ID <- c('p01', 'p02','p03', 'p04', 'p05', 'p06')
guesses <- as.data.frame(cbind(CORRECTNESS,ID))
mdl_null <- glm(CORRECTNESS ~ (1|ID), data = guesses , family = 'poisson')
The warnings:
Warning message in Ops.factor(1, ID):
“‘|’ not meaningful for factors”Warning message in glm.fit(x = structure(numeric(0), .Dim = c(0L, 2L), .Dimnames = list(:
“no observations informative at iteration 1”
Warning message:
“glm.fit: algorithm did not converge”
The error message is either:
Error in glm.fit(x = structure(numeric(0), .Dim = c(0L, 2L), .Dimnames = list(: object 'fit' not found
or:
Error in model.matrix.default(mt, mf, contrasts): variable 1 has no levels
Can someone help me understand? How can I run this model? Thank you.