I am running a probit regression with a random effect:
m1<-glmer(Binary~Explan+(1|Random),family=binomial(link="probit"))
where Explan is a three-level categorical variable.
I want to calculate the mean predicted probabilities for each level of Explan. I tried doing so using this code:
newdata=data.frame(Explan="First")
predict(m1,newdata,type="response")
where First is a level of the categorical Explan variable.
However I get the following error message:
Error: (p <- ncol(X)) == ncol(Y) is not TRUE
Were this a logit model, I would simply strip the model of the intercept and then back-transform the model summary coefficients to get the predicted values that I'm after, but I am unsure of how I would go about this with a mixed-effects probit model.
Any help in extracting the predicted probabilities would be greatly appreciated.