View source: R/simulated_confidence_intervals_of_mean.R
simulated_confidence_intervals_of_mean | R Documentation |
Simulation of Frequentist confidence intervals of the mean of normally-distributed data.
simulated_confidence_intervals_of_mean( n_samples, n_intervals = 1, alpha = 0.05, pop_mean = 0, pop_sd = 1 )
n_samples |
The sample size for the confidence intervals. |
n_intervals |
The number of intervals to generate. |
alpha |
Confidence level |
pop_mean |
Population |
pop_sd |
population standard deviation |
require(ggplot2) ggplot( simulated_confidence_intervals_of_mean(n_samples = 20, n_intervals = 20), aes(x = simulation, colour = in_sample_ci)) + geom_point(aes(y = sample_mean)) + geom_segment(aes(xend = simulation, y = lower_t, yend = upper_t)) + geom_hline(yintercept = 0, lty = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.