nlme
tidiers will soon be deprecated in broom
and there is no ongoing
development of these functions at this time. nlme
tidiers are being
developed in the broom.mixed
package, which is not yet on CRAN.
# S3 method for lme tidy(x, effects = "random", ...) # S3 method for lme augment(x, data = x$data, newdata, ...) # S3 method for lme glance(x, ...)
x | An object of class |
---|---|
effects | Either "random" (default) or "fixed" |
... | extra arguments (not used) |
data | original data this was fitted on; if not given this will attempt to be reconstructed |
newdata | new data to be used for prediction; optional |
All tidying methods return a data.frame
without rownames.
The structure depends on the method chosen.
tidy
returns one row for each estimated effect, either
random or fixed depending on the effects
parameter. If
effects = "random"
, it contains the columns
the group within which the random effect is being estimated
level within group
term being estimated
estimated coefficient
fixed term being estimated
estimate of fixed effect
standard error
t-statistic
P-value computed from t-statistic
predicted values
residuals
predicted values with no random effects
the square root of the estimated residual variance
the data's log-likelihood under the model
the Akaike Information Criterion
the Bayesian Information Criterion
returned as NA. To quote Brian Ripley on R-help: McCullagh & Nelder (1989) would be the authoritative reference, but the 1982 first edition manages to use 'deviance' in three separate senses on one page.
These methods tidy the coefficients of mixed effects models
of the lme
class from functions of the nlme
package.
When the modeling was performed with na.action = "na.omit"
(as is the typical default), rows with NA in the initial data are omitted
entirely from the augmented data frame. When the modeling was performed
with na.action = "na.exclude"
, one should provide the original data
as a second argument, at which point the augmented data will contain those
rows (typically with NAs in place of the new columns). If the original data
is not provided to augment()
and na.action = "na.exclude"
, a
warning is raised and the incomplete rows are dropped.
if (FALSE) { if (require("nlme") & require("lme4")) { # example regressions are from lme4 documentation, but used for nlme lmm1 <- lme(Reaction ~ Days, random=~ Days|Subject, sleepstudy) tidy(lmm1) tidy(lmm1, effects = "fixed") head(augment(lmm1, sleepstudy)) glance(lmm1) startvec <- c(Asym = 200, xmid = 725, scal = 350) nm1 <- nlme(circumference ~ SSlogis(age, Asym, xmid, scal), data = Orange, fixed = Asym + xmid + scal ~1, random = Asym ~1, start = startvec) tidy(nm1) tidy(nm1, effects = "fixed") head(augment(nm1, Orange)) glance(nm1) } }