| ci {gmodels} | R Documentation |
Compute and display confidence intervals for model
estimates. Methods are provided for the mean of a numeric vector
ci.default, the probability of a binomial vector
ci.binom, and for lm, lme, and mer objects are
provided.
ci(x, confidence = 0.95, alpha = 1 - confidence,...)
## Default S3 method:
ci(x, confidence = 0.95, alpha = 1 - confidence,
na.rm = FALSE, ...)
## S3 method for class 'binom'
ci(x, confidence = 0.95, alpha = 1 - confidence,...)
## S3 method for class 'lm'
ci(x, confidence = 0.95, alpha = 1 - confidence,...)
## S3 method for class 'lme'
ci(x, confidence = 0.95, alpha = 1 - confidence,...)
## S3 method for class 'mer'
ci(x, confidence = 0.95, alpha = 1 - confidence,
sim.mer=TRUE, n.sim=10000, ...)
x |
object from which to compute confidence intervals. |
confidence |
confidence level. Defaults to 0.95. |
alpha |
type one error rate. Defaults to 1.0- |
na.rm |
boolean indicating whether missing values should be
removed. Defaults to |
... |
Arguments for methods |
sim.mer |
Logical value. If TRUE confidence
intervals will be estimated using |
n.sim |
Number of samples to take in |
vector or matrix with one row per model parameter and elements/columns
Estimate, CI lower, CI upper, Std. Error,
DF (for lme objects only), and p-value.
Gregory R. Warnes greg@warnes.net
# mean and confidence interval
ci( rnorm(10) )
# binomial proportion and exact confidence interval
b <- rbinom( prob=0.75, size=1, n=20 )
ci.binom(b) # direct call
class(b) <- 'binom'
ci(b) # indirect call
# confidence intervals for regression parameteres
data(state)
reg <- lm(Area ~ Population, data=as.data.frame(state.x77))
ci(reg)
# mer example -- that means lme4 < 1.0
#if(require(lme4)) {
#fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy)
#print(ci(fm2))
#}