Learn R Programming

PASWR (version 1.1)

interval.plot: Interval Plot

Description

Function to graph confidence intervals

Usage

interval.plot(ll, ul)

Arguments

ll

vector of lower confidence interval values

ul

vector of upper confidence interval values

See Also

CIsim

Examples

Run this code
# NOT RUN {
set.seed(402)
m <- 100 # Number of samples
n <- 500 # Sample size
a <- array(0,m)
ll <- array(0,m)
ul <- array(0,m)
i <- 0
while (i < m)
{ i <- i + 1
a[i] <- mean(rnorm(n))
ll[i] <- a[i] + qnorm(0.025)*sqrt(1/n)
ul[i] <- a[i] + qnorm(0.975)*sqrt(1/n)
}
interval.plot(ll,ul)
# }

Run the code above in your browser using DataLab