auto.lm: automatic linear regression

View source: R/auto.lm.R

auto.lmR Documentation

automatic linear regression

Description

conduct linear regression, residual analysis and visualze the result with one function

Usage

auto.lm(formula, data = NULL, xname = substitute(x), yname = substitute(y))

Arguments

formula

formula with two continuous variables in the format of y~x where y is the response variable and x is the predictor variable

data

specifying the dataframe containing the variables of the formula

xname

a character string to specify the name of the x variable and x axis

yname

a character string to specify the name of the y variable and y axis

Author(s)

Tsz-Hong Chan

Examples

#specifying data argument

auto.lm(Sepal.Length~Sepal.Width,subset(iris,iris$Species=="setosa"),xname = "Sepal Width",yname = "Sepal length")

#note that using subset() will distort the extraction of variable name and manually correcting plot axis name with xname and yname arguments is highly recommended

#without specifying data argument
auto.lm(Orange$circumference~Orange$age)

THChan11/autotest documentation built on June 11, 2025, 12:46 a.m.