Calculates the confidence interval of grouped data

run_group.CI(x, data, ci = 0.95)

Arguments

x

(Required). an aggregate compatible formula.

data

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

ci

(optional). numeric. 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

References

https://github.com/cran/Rmisc/

Author

Created by Hua Zou (5/19/2022 Shenzhen China)

Examples

run_group.CI(Sepal.Length~Species, iris, 0.95)
#>      Species Sepal.Length.upper Sepal.Length.mean Sepal.Length.lower
#> 1     setosa           5.106176             5.006           4.905824
#> 2 versicolor           6.082694             5.936           5.789306
#> 3  virginica           6.768715             6.588           6.407285