plotCI.reg {asbio} | R Documentation |
Plots a simple linear regression along with confidence and prediction intervals.
Description
Plots the fitted line from a simple linear regression (y ~ x) and (if requested) confidence and prediction intervals.
Usage
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,...)
Arguments
x |
The explanatory variable, a numeric vector. |
y |
The response variable, a numeric vector |
conf |
The level of confidence; 1 - P(type I error) |
CI |
Logical; should the confidence interval be plotted? |
PI |
Logical; should the prediction interval be plotted? |
resid |
Logical; should residuals be plotted? |
reg.col |
Color of the fitted regression line. |
CI.col |
Color of the confidence interval lines. |
PI.col |
Color of the prediction interval lines. |
reg.lty |
Line type for the fitted regression line. |
CI.lty |
Line type for the confidence interval. |
PI.lty |
Line type for the confidence interval. |
reg.lwd |
Line width for the regression line. |
CI.lwd |
Line widths for the confidence and prediction intervals. |
resid.lty |
Line width for the regression line. |
resid.col |
Line color for residual lines. |
... |
Additional arguments from |
Value
Returns a plot with a regression line and (if requested) confidence and prediction intervals
Author(s)
Ken Aho
See Also
Examples
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)