Description Usage Arguments Details Value See Also Examples
View source: R/normal_sampling_distribution_movie.R
A movie to show how the sampling distributions of the sample mean and sample variance based on a random sample from a normal distribution depend on the size n of the sample.
1 2 | normal_sampling_distns_movie(starting_n = 30, delta_n = 1, mu = 0,
sigma = 1)
|
starting_n |
A numeric scalar. The value of the sample size used to produce the first plot of the p.d.f. |
delta_n |
A numeric scalar. The amount by which the value of the sample size is increased/decreased after one click of the +/- button. |
mu |
A numeric scalar. The mean of the normal distribution from which the random sample are drawn. |
sigma |
A numeric scalar. The standard deviation of the normal distribution from which the random sample are drawn. |
The movie is based on two plots. The top plot shows the
probability density function (p.d.f.) of the sampling distribution of the
sample mean, that is, a N(μ, σ^2 / n) distribution.
The bottom plot contains the p.d.f. of the sampling distribution of the
sample variance, that is, a gamma distribution
(GammaDist
) with shape parameter
(n - 1) / 2 and rate parameter (n - 1) / 2σ^2.
The number of samples simulated is increased
The value of the sample size can be changed using the +/- buttons in the panel. For the purposes of this movie the value of n cannot exceed 100.
Nothing is returned, only the animation is produced.
movies
: general information about the movies.
1 2 3 4 5 6 7 8 | # Load package rpanel
# [Use install.packages("rpanel") if necessary]
library(rpanel)
## Not run:
normal_sampling_distns_movie()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.