Extract Residual Standard Deviation 'Sigma'
sigma.RdExtract the estimated standard deviation of the errors, the
“residual standard deviation” (also misnamed the
“residual standard error”), from a fitted model of class
merMod.
Value
The value differs based on the family (see details above for an explanation.)
For Gaussian fitted models, this is the residual standard deviation.
For Gamma and Inverse Gaussian fitted models, it represents the square root of the inverse of the shape parameter.
For Binomial and Poisson fitted models, the value is always reported as
1, since their variance is determined entirely by the mean and there is no separate scale parameter.
Details
In general the dispersion parameter (which we call sigma) is the
square root of the constant multiplier in the 'variance function' provided
by the family functions.
For Gaussian fits,
gaussian()$variance = rep.int(1, length(mu))and it's known that the variance is \(\sigma^{2}\). Hence, the constant multiplier of the variance function in this case is \(\sigma^{2}\), so we saysigmais \(\sqrt{\sigma}\).For Gamma fits,
Gamma()$variance = mu^2wheremu = scale*shape. The known variance is \(\frac{\mu^{2}}{\code{shape}}\). Thus, the constant multiplier here is \(\frac{1}{\sqrt{\code{shape}}}\).Similarly, for Inverse Gaussian fits, we have
inverse.gaussian()$variance = mu^{3}, with known variance \(\frac{\mu^{3}}{\lambda}\); similarly, the constant multiplier here is \(\frac{1}{\sqrt{\lambda}}\). \(\lambda\) is referred to as the shape parameter.
Examples
methods(sigma)# from R 3.3.0 on, shows methods from pkgs 'stats' *and* 'lme4'
#> [1] sigma.default* sigma.glm* sigma.gls* sigma.lmList* sigma.lmList4*
#> [6] sigma.lme* sigma.merMod* sigma.mlm*
#> see '?methods' for accessing help and source code