Learn R Programming

mosaic (version 0.4-1)

confint.numeric: Confidence interval methods for output of resampling

Description

Methods for confint to compute confidence intervals on numerical vectors and numerical components of data frames.

Usage

## S3 method for class 'numeric':
confint(object, parm, level = 0.95,
    ..., method = c("stderr", "quantile"), margin = FALSE)

## S3 method for class 'data.frame': confint(object, parm, level = 0.95, ..., method = c("stderr", "quantile"), margin = FALSE)

Arguments

object
The data frame or numerical vector.
parm
not used -- for compatibility with other confint methods
level
confidence level (default 0.95)
...
additional arguments (currently ignored)
method
either "stderr" (default) or "quantile"
margin
if true, report intervals as a center and margin of error.

Value

  • When applied to a data frame, returns a data frame giving the confidence interval for each variable in the data frame. When applied to a numerical vector, returns a vector.

Examples

Run this code
s <- do(500)*mean( age ~ sex, data=resample(HELPrct) )
confint(s)
confint(s, method="quantile")
confint(s, margin=TRUE)
confint(s, margin=TRUE, level=0.99 )
s2 <- do(500)*mean( resample(1:10) )
confint(s2)

Run the code above in your browser using DataLab