printCI: Produce a formatted confidence interval

Description Usage Arguments Value Author(s) See Also Examples

Description

Takes a vector of length two and prints out a confidence interval in a user specified format.

Usage

1
printCI(x, fmt)

Arguments

x

A vector of length two containing the lower and upper bounds of a confidence interval

fmt

A format string to be used by sprintf. Note that this format string is repeated twice in the code for each bound of the confidence interval.

Value

A string containing the formatted CI

Author(s)

James Curran

See Also

sprintf

Examples

1
2
3
4
5
6
n = 100
x = rnorm(n)
mx = mean(x)
se = sd(x)/sqrt(n)
ci = mx + qnorm(c(0.025,0.975))*se
printCI(ci, '%5.2f')


Search within the dafs package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.