powered by
Plots the fitted line from a simple linear regression (y ~ x) and (if requested) confidence and prediction intervals.
plotCI.reg(x, y, conf = 0.95, CI = TRUE, PI = TRUE, resid = FALSE, reg.col = 1, CI.col = 2, PI.col = 4, reg.lty = 1, CI.lty = 2, PI.lty = 3, reg.lwd = 1, CI.lwd = 1, resid.lty = 3, resid.col = 4,...)
Returns a plot with a regression line and (if requested) confidence and prediction intervals
The explanatory variable, a numeric vector.
The response variable, a numeric vector
The level of confidence; 1 - P(type I error)
Logical; should the confidence interval be plotted?
Logical; should the prediction interval be plotted?
Logical; should residuals be plotted?
Color of the fitted regression line.
Color of the confidence interval lines.
Color of the prediction interval lines.
Line type for the fitted regression line.
Line type for the confidence interval.
Line width for the regression line.
Line widths for the confidence and prediction intervals.
Line color for residual lines.
Additional arguments from plot
plot
Ken Aho
plot, predict
predict
y<-c(1,2,1,3,4,2,3,4,3,5,6) x<-c(2,3,1,4,5,4,5,6,7,6,8) plotCI.reg(x,y)
Run the code above in your browser using DataLab