powered by
This function calculates the confidence interval (for a given confidence level) for a variable in a given data frame.
ci.calc(df, var1, cl)
This function returns the mean, lower bound, upper bound, and standard error.
data frame to read in.
the variable of interest for which the CI will be calculated.
the desired confidence level (in percentages, ranging from \(1\) to \(100\)).
data <- mtcars ci.calc(data,mpg,95)
Run the code above in your browser using DataLab