Description Usage Arguments Details Value See Also Examples
This function finds the labels of coefficients associated with interactions or main effects in the results of various model fitting functions.
1 |
model |
a model object. |
ef |
a character string (a coefficent label). |
order |
a character string vector giving the order of the
terms to be returned.
One of |
include.base |
logical. Should the labels in |
model is an object returned by a model fitting
function (e.g., lm, aov).
The character string passed to ef must not include the
intercept ("(Intercept)") since it cannot be part of an
interaction. All non-intercept labels of any order are allowed.
If order is "higher", all terms of a higher order
are returned. If order is "lower", all terms of a
lower order are returned. If order is "all" then
both terms of lower and higher order are returned. For example,
if a model fit has the terms A, B, C,
A:B, B:C, A:C, and A:B:C, terms of
higher order relative to A are A:B, A:C,
and A:B:C. Terms of lower order relative to A:B are
A and B.
If include.base is FALSE (the default), the term
label in ef is not part of the returned string vector.
asef returns vectors of character strings
(coefficent labels).
terms for extracting model terms.
1 2 3 4 5 6 7 8 9 10 11 12 13 | require(utils)
data(iris)
fit <- lm(Sepal.Length ~ Sepal.Width * Petal.Length * Petal.Width, data = iris)
asef(fit, "Petal.Length:Petal.Width", order = "higher")
asef(fit, "Sepal.Width:Petal.Length:Petal.Width", order = "lower")
asef(fit, "Petal.Length:Petal.Width", order = "all")
data(warpbreaks)
fit2 <- lm(breaks ~ wool * tension, data = warpbreaks)
# Since wool is a factor, the coefficient has another name, "woolB"
asef(fit2, "woolB", order = "higher")
asef(fit2, "woolB", order = "higher", include.base = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.