Extract the estimated standard deviation of the errors, the
“residual standard deviation” (also misnamed the
“residual standard error”), from a fitted model of class
merMod.
# S3 method for merMod
sigma(object, ...)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.
a fitted model.
additional, optional arguments, passed from or to methods. (None currently in our two methods.)
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 say sigma is \(\sqrt{\sigma}\).
For Gamma fits, Gamma()$variance = mu^2 where
mu = 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.
Package lme4 provides methods for mixed-effects models of class
merMod and lists of linear models,
lmList4.
methods(sigma)# from R 3.3.0 on, shows methods from pkgs 'stats' *and* 'lme4'
Run the code above in your browser using DataLab