meanCI.data.frame {interpretCI} | R Documentation |
Calculate confidence intervals of mean or difference between means in a data.frame
Description
Calculate confidence intervals of mean or difference between means in a data.frame
Usage
## S3 method for class 'data.frame'
meanCI(x, ...)
meanCI_sub(data = data, x, y, group, paired = FALSE, idx = NULL, ...)
Arguments
x |
Name of a categorical or numeric column. If !missing(y), name of continuous variable |
... |
Further arguments to be passed to meanCI |
data |
A data.frame |
y |
Name of a numeric column |
group |
Name of categorical column |
paired |
logical |
idx |
A vector containing factors or strings in the x columns. These must be quoted (ie. surrounded by quotation marks). The first element will be the control group, so all differences will be computed for every other group and this first group. |
Value
An object of class "meanCI" which is a list containing at least the following components:
- data
A tibble containing raw data or a list of numeric vector
- result
A data.frame consists of summary statistics
- call
the matched call
- attr(*,"measure")
character. One of c("mean","unpaired","paired")
Methods (by generic)
-
meanCI
: S3 method for data.frame
Examples
meanCI(acs,age)
meanCI(acs,sex,age)
meanCI(acs,Dx,age)
acs %>% select(age) %>% meanCI()
acs %>% select(sex,age) %>% meanCI()
meanCI(iris,Species,Sepal.Length)
meanCI(iris,Sepal.Width,Sepal.Length,paired=TRUE)
meanCI(iris,Sepal.Length,Sepal.Width)
iris %>% select(starts_with("Petal")) %>% meanCI(paired=TRUE)
iris %>% meanCI(paired=TRUE)
meanCI(acs,sex,age,Dx,mu=10)
acs %>% select(sex,TC,TG,HDLC) %>% meanCI(group=sex)
acs %>% select(sex,TC,TG,HDLC) %>% meanCI(sex)
iris %>% select(Species,starts_with("Sepal")) %>% meanCI(Species)
iris %>% select(Species,starts_with("Sepal")) %>% meanCI(group=Species)