
Last chance! 50% off unlimited learning
Sale ends in
simCLT(ns, n, p1=0, p2=1, type=c("normal", "uniform", "lognormal", "antinormal"), color.fill="lightsteelblue3", n.display=2, digits.d=3, subtitle=TRUE, pop=TRUE, main=NULL, pdf=FALSE, pdf.width=5, pdf.height=5, ...)
TRUE
, then display the specific parameter values of the population or sample, depending on the graph.TRUE
, then display the graph of the population from which the data are sampled.lm
which provides the core computations.Four different populations are provided: normal, uniform, lognormal for a skewed distribution, and what is called the anti-normal, the combining of two side-by-side triangular distributions so that most of the values are in the extremes and fewer values are close to the middle.
For the lognormal distribution, increase the skew by increasing the value of p2
, which is the population standard deviation.
The anti-normal distribution requires the triangle
package. No population mean and standard deviation are provided for the anti-normal distribution, so the 95% range of sampling variable of the sample mean in terms of standard errors is not provided. ** Not activated until the triangle package is updated. **
If the two plots, of the population and sample distributions respectively, are written to pdf files, according to pdf=TRUE
, they are named SimPopulation.pdf and SimSample.pdf. Their names and the directory to which they are written are provided as part the console output.
# plot of the standardized normal
# and corresponding sampling distribution with 10000 samples
# each of size 2
simCLT(ns=1000, n=2)
# plot of the uniform dist from 0 to 4
# and corresponding sampling distribution with 10000 samples
# each of size 2
simCLT(ns=1000, n=2, p1=0, p2=4, type="uniform", bin.width=0.01)
# save the population and sample distributions to pdf files
simCLT(100, 10, pdf=TRUE)
Run the code above in your browser using DataLab