Dear Ben,
I am a user of your excellent work lme4. While during my work I realized the
problem that the package doesn't provide function to return standardized
coefficients.
I found a section of code on your website:
##
lm.beta.lmer <- function(mod) {
b <- fixef(mod)[-1] ## fixed-effect coefs, sans intercept
sd.x <- apply(mod @ X[,-1],2,sd) ## pull out model (design) matrix,
## drop intercept column, calculate
## sd of remaining columns
sd.y <- sd(mod @ y) ## sd of response
b*sd.x/sd.y
}
##
But I couldn't make it work, every time it showed:
Error in apply(Mod at x[, -1], 2, sd) : no slot of name "x" for this object of
class "lmerMod"
Could you please help me figure it out? Thank you very much!
standardized coefficients in lme4 package
2 messages · Simon Sun, Andrea Cantieni
2 days later
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20140505/3bd790d4/attachment.pl>