HH (version 2.2-17)

ci.plot: Plot confidence and prediction intervals for simple linear regression

Description

The data, the least squares line, the confidence interval lines, and the prediction interval lines for a simple linear regression (lm(y ~ x)) are displayed. Tick marks are placed at the location of xbar, the x-value of the narrowest interval.

Usage

ci.plot(lm.object, ...)

## S3 method for class 'lm':
ci.plot(lm.object,
        xlim=range(data[, x.name]),
        newdata,
        conf.level=.95,
        data=model.frame(lm.object),
        newfit,
        ylim,
        pch=16,
        main.cex=1,
        main=list(paste(100*conf.level,
          "% confidence and prediction intervals for ",
          substitute(lm.object), sep=""), cex=main.cex), ...
        )

Arguments

Value

"trellis" object containing the plot.

See Also

lm, predict.lm

Examples

Run this code
tmp <- data.frame(x=rnorm(20), y=rnorm(20))
tmp.lm <- lm(y ~ x, data=tmp)
ci.plot(tmp.lm)

Run the code above in your browser using DataCamp Workspace