Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simple.lm

Simplify usage of lm


Description

Simplify usage of lm by avoiding model notation, drawing plot, drawing regression line, drawing confidence intervals.

Usage

simple.lm(x, y, show.residuals=FALSE, show.ci=FALSE, conf.level=0.95,pred=)

Arguments

x

The predictor variable

y

The response variable

show.residuals

set to TRUE to plot residuals

show.ci

set to TRUE to plot confidence intervals

conf.level

if show.ci=TRUE will plot these CI's at this level

pred

values of the x-variable for prediction

Value

returns plots and an instance of lm, as though it were called lm(y ~ x)

Author(s)

John Verzani

See Also

lm

Examples

## on simulated data
x<-1:10
y<-5*x + rnorm(10,0,1)
tmp<-simple.lm(x,y)
summary(tmp)

## predict values
simple.lm(x,y,pred=c(5,6,7))

UsingR

Data Sets, Etc. for the Text "Using R for Introductory Statistics", Second Edition

v2.0-6
GPL (>= 2)
Authors
John Verzani <verzani@math.csi.cuny.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.