Description Usage Arguments Details Value See Also Examples
The function returns the labels of the coefficients of the model. Note: The terms are not identical to the coefficients.
1 |
model |
a model object. |
term |
a character vector of term labels. |
as.list |
logical. Should the result be returned as a list? |
model
is an object returned by a model fitting
function (e.g., lm
, aov
).
The character string passed to term
must not include the
intercept ("(Intercept)"
).
All non-intercept labels in any order are allowed.
either a character vector (if as.list = FALSE
)
or a list with character vectors (otherwise) with one
list element for each element in term
.
coef2term
for the inverse function.
1 2 3 4 5 6 7 8 9 10 11 12 13 | require(utils)
data(iris)
fit <- lm(Sepal.Length ~ poly(Sepal.Width, 3), data = iris)
summary(fit)
term2coef(fit, "poly(Sepal.Width, 3)")
data(warpbreaks)
fit2 <- lm(breaks ~ wool * tension, data = warpbreaks)
summary(fit2)
term2coef(fit2, c("wool", "tension"))
term2coef(fit2, c("wool", "tension"), as.list = TRUE)
term2coef(fit2, c("wool:tension"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.