This collection of functions is useful for extracting estimates and statistics from a fitted
model. They are particularly useful when estimating many models, like when bootstrapping
confidence intervals. Each function can be used with an already fitted model as an lm
object,
or a formula and associated data can be passed to it. All of these assume the comparison is the
empty model.
b0(object, data = NULL)b1(object, data = NULL)
b(object, data = NULL, all = FALSE, predictor = character())
f(object, data = NULL, all = FALSE, predictor = character(), type = 3)
pre(object, data = NULL, all = FALSE, predictor = character(), type = 3)
p(object, data = NULL, all = FALSE, predictor = character(), type = 3)
fVal(object, data = NULL, all = FALSE, predictor = character(), type = 3)
PRE(object, data = NULL, all = FALSE, predictor = character(), type = 3)
The value of the estimate as a single number.
If object
is a formula, the data to fit the formula to as a data.frame
.
If TRUE
, return a named list of all related terms (e.g. all F-values).The name
for the full model value is the name of the function (e.g. "f"), and the names for the
constituent terms are the term names prefixed by the function name (e.g. "f_a:b" for the
F-value of the a:b
interaction term).
Filter the output down to just the statistics for these terms (e.g. "hp" to
just get the statistics for that term in the model). This argument is flexible: you can pass
a character vector of terms (c("hp", "hp:cyl")
), a one-sided formula (~hp
), or a list of
formulae (c(~hp, ~hp:cyl)
).
The type of sums of squares to calculate (see generate_models()
). Defaults to the
widely used Type III
SS.
b0
: The intercept from the full model.
b1
: The slope b1 from the full model.
b
: The coefficients from the full model.
f
: The F value from the full model.
pre
: The Proportional Reduction in Error for the full model.
p
: The p-value from the full model.
sse
: The SS Error (SS Residual) from the model.
ssm
: The SS Model (SS Regression) for the full model.
ssr
: Alias for SSM.
Judd, C. M., McClelland, G. H., & Ryan, C. S. (2017). Data Analysis: A Model Comparison Approach to Regression, ANOVA, and Beyond (3rd ed.). New York: Routledge. ISBN:879-1138819832
supernova(lm(mpg ~ disp, data = mtcars))
change_p_decimals <- supernova(lm(mpg ~ disp, data = mtcars))
print(change_p_decimals, pcut = 8)
Run the code above in your browser using DataLab