normal_sampling_distns_movie: Normal sampling distributions movie

Description Usage Arguments Details Value See Also Examples

View source: R/normal_sampling_distribution_movie.R

Description

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.

Usage

1
2
normal_sampling_distns_movie(starting_n = 30, delta_n = 1, mu = 0,
  sigma = 1)

Arguments

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.

Details

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.

Value

Nothing is returned, only the animation is produced.

See Also

movies: general information about the movies.

Examples

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)

paulnorthrop/stat1004 documentation built on Nov. 17, 2019, 3:49 a.m.