Learn R Programming

sasLM (version 1.0.1)

lr0: Simple Linear Regressions with Each Independent Variable

Description

Usually, the first step in multiple linear regression is to perform simple linear regressions with each single independent variable.

Usage

lr0(Formula, Data)

Value

Each row means one simple linear regression with that row name as the only independent variable.

Intercept

estimate of the intercept

SE(Intercept)

standard error of the intercept

Slope

estimate of the slope

SE(Slope)

standard error of the slope

Rsq

R-squared for the simple linear model

Pr(>F)

p-value of the slope or the model

Arguments

Formula

a conventional formula for a linear model. The intercept will always be added.

Data

a data.frame to be analyzed

Author

Kyun-Seop Bae k@acr.kr

Details

It performs simple linear regression for each independent variable.

Examples

Run this code
  lr0(uptake ~ Plant + Type + Treatment + conc, CO2)
  lr0(mpg ~ ., mtcars)

Run the code above in your browser using DataLab