0
$\begingroup$

I was going to generate the marginal residuals of a variable by using linear mixed model in R. The marginal residuals are the residuals after adjusting for the fixed effects in the linear mixed model. and I need to use that residual as a new dependent variable used in another linear mixed effect model. I was trying to use "redres" package in R https://github.com/goodekat/redres, but can't even install it. Here's the error:

restarting interrupted promise evaluationinternal error -3 in R_decompress1Error: Failed to install 'redres' from GitHub:
  lazy-load database '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/callr/R/callr.rdb' is corrupt

Anyone has any idea how to install it and any other packages can be used to generate the marginal residuals of a variable? Thanks!

$\endgroup$

1 Answer 1

0
$\begingroup$

after a lot of digging, I found another package that can be used for generating the marginal residuals.

library(HLMdiag)
hlm_resid(your-own-linear-mixed-effect-model,standardize=TRUE)

which would give you standardised marginal residuals.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.