mean_ci: Calculate A Mean with Confidence Intervals

Description Usage Arguments Examples

View source: R/mean_ci.R

Description

This function gives you a mean with 95 percent CIs

Usage

1
mean_ci(df, var, wt, ci = 0.95)

Arguments

df

Name of the Dataset

var

Variable to find the mean of

wt

Weight to be applied

ci

Confidence Interval, expressed as a decimal. i.e. .84. Defaults to .95

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
cces <- read_csv("https://raw.githubusercontent.com/ryanburge/blocks/master/cces.csv")

cces %>% 
   mean_ci(gender)
   
# Weighted Means    

cces %>% 
   mean_ci(gender, wt = commonweight_vv)
   
# Change the Confidence Interval

cces %>% 
   mean_ci(gender, ci = .84)

ryanburge/socsci documentation built on June 6, 2020, 2:37 a.m.