group.CI: Group Confidence Interval

Description Usage Arguments Value Examples

Description

Calculates the confidence interval of grouped data

Usage

1
group.CI(x, data, ci = 0.95)

Arguments

x

an 'aggregate' compatible formula

data

a data frame (or list) from which the variables in formula should be taken

ci

the confidence interval to be calculated

Value

A data frame consisting of one column for each grouping factor plus three columns for the upper bound, mean and lower bound of the confidence interval for each level of the grouping factor

Examples

1
2
3
4
5
6
7
8
9
require(latticeExtra)
with(group.CI(weight~feed,chickwts),
 segplot(feed~weight.lower+weight.upper,center=weight.mean)
)

require(Hmisc)
with(group.CI(Temp~Month,airquality),
 xYplot(Cbind(Temp.mean,Temp.lower,Temp.upper)~numericScale(Month),type="b",ylim=c(60,90))
)

RyanHope/Rmisc documentation built on May 9, 2019, 10:38 a.m.