auto.lm | R Documentation |
conduct linear regression, residual analysis and visualze the result with one function
auto.lm(formula, data = NULL, xname = substitute(x), yname = substitute(y))
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 |
Tsz-Hong Chan
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.