R: Confidence intervals of a simple linear regression
reg.ci
R Documentation
Confidence intervals of a simple linear regression
Description
Computes and add to a graph the confidence interval of a simple regression line or of individual values.
Usage
reg.ci(model, conf.level = 0.95, type = c("mean", "ind"), ...)
Arguments
model
lm model.
conf.level
confidence level.
type
interval type : "mean" for the interval of the regression line (default), "ind" for the interval of individual values (also called "prediction interval").
...
other agruments. See help of lines.
Author(s)
Maxime Herv<c3><a9> <mx.herve@gmail.com>
See Also
lm
Examples
x <- 1:50
y <- 1:50+rnorm(50,0,4)
regression <- lm(y~x)
plot(x,y)
abline(regression)
reg.ci(regression,type="mean",col="red")
reg.ci(regression,type="ind",col="blue")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(RVAideMemoire)
*** Package RVAideMemoire v 0.9-56 ***
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RVAideMemoire/reg.ci.Rd_%03d_medium.png", width=480, height=480)
> ### Name: reg.ci
> ### Title: Confidence intervals of a simple linear regression
> ### Aliases: reg.ci
>
> ### ** Examples
>
> x <- 1:50
> y <- 1:50+rnorm(50,0,4)
> regression <- lm(y~x)
> plot(x,y)
> abline(regression)
> reg.ci(regression,type="mean",col="red")
> reg.ci(regression,type="ind",col="blue")
>
>
>
>
>
> dev.off()
null device
1
>