View source: R/df_from_model.R
df_from_model | R Documentation |
df_from_model
creates and returns a data.frame from a
model object such as a(n): aov
,
lm
, or glm
object.
The return data.frame will contain two columns, one for
residuals ('res'), and a second for fitted values ('fit').
df_from_model(model, type = "rstandard")
model |
A model object such as a(n): |
type |
The type of residuals to be returned in the data.frame.
The residual type supplied must match a function name, for example:
|
The output will be a two-column data.frame
with columns 'res' and 'fit' containing the residuals and fitted values.
plot.lm, residual_plots, gg_residual_plots
data(npk)
npk.aov <- aov(yield ~ block + N*P*K, npk)
summary(npk.aov)
npk.aov1 <- aov(yield ~ block + N + K, data = npk)
summary(npk.aov1)
summary.lm(npk.aov1)
model.tables(npk.aov1, type = "means", se = TRUE)
plot(npk.aov1)
npk.table <- df_from_model(npk.aov1, type = "rstandard")
df_from_model(npk.aov1, type = rstandard)
df_from_model(npk.aov1)
df_from_model(npk.aov1, type = "rstudent")
df_from_model(npk.aov1, type = "residuals")
df_from_model(npk.aov1, type = "resid")
rm(list = c("npk", "npk.aov", "npk.aov1", "npk.table"))
## Not run:
df_from_model(npk.aov1, resid)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.