Learn R Programming

seeg (version 1.0)

ConfInt: Conf Int Functions

Description

Functions to obtain confidence interval for a regression.

Usage

conf.int.lm(dat.lm, alpha)

Arguments

dat.lm
data frame used for regression
alpha
alpha or error type I

Value

  • lowerlower value of confidence interval
  • upperupper value of confidence interval

Details

Calculates and plots the confidence intervals for a regression (Follows MathSoft 1999, pages 7-26 to 7-29).

References

Acevedo M.F. 2013. "Data Analysis and Statistics for Geography, Environmental Science, and Engineering", CRC Press. MathSoft, 1999. S-PLUS 2000 Guide to Statistics Volume 1 and Volume 2.

See Also

linear regression lm, plots plot

Examples

Run this code
light.depth <- read.table(file="lab6/light-depth.csv",sep=",",header=TRUE)
attach(light.depth)
light.lm <- lm(Light ~ Depth) 
par(mfrow=c(2,1))
plot(Depth, Light)    
abline(light.lm$coef)
conf.int.lm(light.lm, 0.05)

Run the code above in your browser using DataLab