Description Usage Arguments Value Examples
According to the central limit theorem, the mean of the samples taken from a population would be normally distributed regardless of the distribution of the population.
1 | calculate_sample_means(x, n, size, replace = FALSE, na.rm = TRUE)
|
x |
an atomic numeric vector. |
n |
number of samples to be taken. |
size |
sample size to choose. |
replace |
should sampling done with replacement? default value is FALSE. |
na.rm |
remove NAs when calculating arithmetic mean. default value is TRUE. |
This function takes n
number of samples with a size of size
and
returns a vector with a length of n
.
1 2 | data <- runif(1e3)
sm <- calculate_sample_means(data, 1e2, 40) # now look at the hist(sm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.