see_the_clt_for_Bernoulli {ipsRdbs}R Documentation

Illustration of the CLT for samples from the Bernoulli distribution

Description

Illustration of the CLT for samples from the Bernoulli distribution

Usage

see_the_clt_for_Bernoulli(nsize = 10, nrep = 10000, prob = 0.8)

Arguments

nsize

Sample size, n. Its default value is 10.

nrep

Number of replications. How many samples of size nsize should be taken, default value is 10000.

prob

True probability of success for the Bernoulli trials

Value

A vector of means of the replicated samples. It also has the side effect of drawing a histogram of the standardized sample means and a superimposed density function of the standard normal distribution. The better the CLT approximation, the closer are the superimposed density and the histogram.

Examples

a <- see_the_clt_for_Bernoulli()
old.par <- par(no.readonly = TRUE)
par(mfrow=c(2, 3))
a30 <- see_the_clt_for_Bernoulli(nsize=30)
a50 <- see_the_clt_for_Bernoulli(nsize=50)
a100 <- see_the_clt_for_Bernoulli(nsize=100)
a500 <- see_the_clt_for_Bernoulli(nsize=500)
a1000 <- see_the_clt_for_Bernoulli(nsize=1000)
a5000 <- see_the_clt_for_Bernoulli(nsize=5000)
par(old.par)

[Package ipsRdbs version 1.0.0 Index]