Description Usage Arguments Value Examples
Computes the confidence interval based on Student's t-distribution or the standard normal distribution. Also reports descriptive statistics (such as the mean). Missings are ignored.
1 2 3 |
x |
A numeric (or logical) vector (such as a variable) |
conf.level |
Confidence level of the interval. Defaults to 0.95. |
dist |
Distribution the confidence interval should be based on. "t" or "student" (default) for Student's t-distribution, "z" or "normal" for standard normal distribution. |
incl_n |
A locigal indicating whether the number of observations should be included in the returned results. Defaults to TRUE. |
incl_mean |
A locigal indicating whether the mean should be included in the returned results. Defaults to TRUE. |
incl_SD |
A locigal indicating whether the standard deviation should be included in the returned results. Defaults to TRUE. |
incl_SE |
A locigal indicating whether the standard error should be included in the returned results. Defaults to TRUE. |
incl_error |
A locigal indicating whether the error based on the confidence level (i.e., the number that is substracted or added to the mean lower and upper bounds of the confidence interval) should be included in the returned results. Defaults to TRUE. |
A numeric vector with at least the lower and upper bounds of the confidence interval.
1 2 3 4 5 6 7 | ## The height of ten people in cm
heights <- c(160, 163, 168, 169, 174, 176, 177, 178, 182, 190)
get_CI(heights) # Defaults
get_CI(heights, dist = "normal") # Using standard normal distribution
get_CI(heights, conf.level = 0.9) # 90%-CI
get_CI(heights, incl_SD = FALSE) # Do not include standard deviation
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.