powered by
Simplify usage of lm by avoiding model notation, drawing plot, drawing regression line, drawing confidence intervals.
simple.lm(x, y, show.residuals=FALSE, show.ci=FALSE, conf.level=0.95,pred=)
The predictor variable
The response variable
set to TRUE to plot residuals
set to TRUE to plot confidence intervals
if show.ci=TRUE will plot these CI's at this level
values of the x-variable for prediction
returns plots and an instance of lm, as though it were called lm(y ~ x)
lm(y ~ x)
lm
# NOT RUN { ## 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)) # }
Run the code above in your browser using DataLab