I have categorized a patient's pattern of screening for a disease (annual, biennial, or else) and would now like to regress patient demographics on this pattern while adjusting for primary care provider (PCP) characteristics. I'm quite sure this requires a multinomial mixed effects model.
My response variable, "Pattern", is a character variable with 3 unordered factors and my grouping variable is "PCP", the PCP's ID. Here's a simplified reproducible example:
df<-data.frame("ID"=seq(1:20),
"PCP"=rep((seq(1:10)*100),2),
"Pattern"=rep(c("Annual","Biennial","Biennial","Annual","Else"),4),
"Age"=runif(20,50,70))
df$PCP<-as.factor(as.character(df$PCP))
When I run what I believe the regression should be I get the following:
mod1<-glmer(Pattern~Age + (1|PCP), data=df)
Error in mkRespMod(fr, REML = REMLpass) : response must be numeric
In addition: Warning message:
In glmer(Pattern ~ Age + (1 | PCP), data = df) :
calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is deprecated; please call lmer() directly
Any help in troubleshooting would be most appreciated.