regress: Regression Analysis

View source: R/regress.R

regressR Documentation

Regression Analysis

Description

regress fits a multiple linear or a logistic regression model, depending on the response variable.

Usage

regress(formula, data, ...)

Arguments

formula

on object of class "formula"

data

a data frame

...

optional parameters pass to the fitting functions

Details

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.

Value

an object of class "lm" or "glm".

See Also

lm, glm, info

Examples

# multiple linear regression
fit <- regress(mpg ~ hp + wt, mtcars)
fit

# logistic regression
fit <- regress(am ~ hp + wt, mtcars)
fit


Rkabacoff/qacReg documentation built on Aug. 1, 2022, 11:11 p.m.