regress | R Documentation |
regress
fits a multiple linear or
a logistic regression model, depending on the response variable.
regress(formula, data, ...)
formula |
on object of class |
data |
a data frame |
... |
optional parameters pass to the fitting functions |
The function is a wrapper for the lm
and glm
functions. If the response variable has only two possible values, a logistic regression
model is fit using glm
with family=binomial
.
Otherwise a linear model (lm
) is returned.
an object of class "lm"
or "glm"
.
lm
, glm
, info
# multiple linear regression fit <- regress(mpg ~ hp + wt, mtcars) fit # logistic regression fit <- regress(am ~ hp + wt, mtcars) fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.