Random Intercept Random Slope Model - check model Assumption does not work

mm_corr <- lmer(hormonelevel ~ 1+days+sex+(1+days|ID),
my_assignment,REML=FALSE)

summary(mm_corr)
ranef(mm_corr)
randomeffects_corr<-ranef(mm_corr)
residuals_corr<-residuals(mm_corr)

check independence of random intercepts & residuals

plot(rep(randomeffects_corr$ID[,1],each=10),
residuals_corr,xlab="random intercept",ylab="residual",
main="independence of random intercepts & \n residuals")

check independence of random slopes & residuals

plot(rep(randomeffects_corr$ID[,2],each=10),
residuals_corr,xlab="random slope",ylab="residual",
main="independence of random slopes & \n residuals")

I always get an error message that x and y length differ. However I was just reproducing data and now nothing works anymore. Can anyone help me

Hello.
Thanks for providing code , but you could take further steps to make it more convenient for other forum users to help you.

Share some representative data that will enable your code to run and show the problematic behaviour.

You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.

Reprex Guide

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.