Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Misleading y label in the qqmath function #394

Open
ylazar opened this Issue Aug 28, 2016 · 3 comments

Comments

Projects
None yet
3 participants

ylazar commented Aug 28, 2016 edited

The lme4::lmer documentation states that

In contrast to plot.lm, these scale-location and Q-Q plots are based on raw rather than
standardized residuals.

However, when running the Q-Q plot command that this statement refers to (lattice::qqmath()),

qqmath(fm1, id = 0.05)

the resulting y axis states "standardized residuals":
qqmath
So at least one of the two - documentation or label - must be incorrect.

Owner

mmaechler commented Aug 29, 2016 edited

What version is your lme4? I don't see any such statements in the lme4::lmer documentation, namely the help page for lmer, neither in the CRAN version of lme4, nor in the development version.
So where exactly did you find that ?

ylazar commented Aug 29, 2016

I meant the corresponding vignette, available at CRAN. You can find it at the top of page 33.

Owner

bbolker commented Sep 1, 2016

I think this is a confusion (on whose part I won't say) between the different possible ways of scaling residuals. What we meant in the vignette was that the residuals are not adjusted to account for difference in influence. For a hint of the confusion surrounding this issue see here ...

Any suggestions for clarifying this without further muddying the waters would be appreciated ...

  1. scaling by any user-specified weights or GLM weights
  2. scaling by a residual variance/overdispersion term
  3. scaling by influence (hat matrix)

From ?plot.lm ('scaling 3')

The ‘S-L’, the Q-Q, and the Residual-Leverage plot, use
standardized residuals which have identical variance (under the
hypothesis). They are given as R[i] / (s * sqrt(1 - h.ii)) where
h.ii are the diagonal entries of the hat matrix, ‘influence()$hat’
(see also ‘hat’), and where the Residual-Leverage plot uses
standardized Pearson residuals (‘residuals.glm(type = "pearson")’)
for R[i].

From ?residuals.merMod ("scaling 1" vs "scaling 1 and 2")

Note that the meaning of ‘"pearson"’ residuals differs
between ‘residuals.lm’ and ‘residuals.lme’. The former
returns values scaled by the square root of user-specified
weights (if any), but not by the residual standard
deviation, while the latter returns values scaled by the
estimated standard deviation (which will include the effects
of any variance structure specified in the ‘weights’
argument). To replicate ‘lme’ behaviour, use
‘type="pearson"’, ‘scaled=TRUE’.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment