# ::Free Statistics and Forecasting Software::

v1.1.23-r7
Secure website (SSL) | Donate to wessa.net

### :: Sampling Distribution of the Sample Mean - Free Statistics Software (Calculator) ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

Sampling Distribution of the Sample Mean: sdsm() and CLT.unif and CLT.exp. The very difficult concept of the sampling distribution of the sample mean is basic to statistics both for its importance for applications, and for its use as an example of modeling the variability of a statistic. sdsm() defaults uses a sample size of n=25 - it shows what a typical sample looks like relative to the density function (standard normal) and then shows a similarly-scaled diagram with the simulated sampling distribution of the sample mean. The emphasis is on the precision of averages, rather than the normality aspect. The normality from the CLT is easier to understand than the precision-of-averages aspect, and so the latter is the focus here. One can use the program with different sample sizes: sdsm(ssize=10), sdsm(ssize=50), sdsm(ssize=100) can be tried here. To make the point about the normality of the sdsm, use CLT.unif() or CLT.exp(), which use uniform(0,1) or exponential(1) as the population and show the sdsm as approximately normal. The default sample size is 10 but CLT.unif(25) or CLT.exp(25) works for sample size 25 and any other sample size can also be used this way.

 Replications Sample Size Mean Standard Deviation Chart options Width: Height:

Click here to edit the underlying code of this R Module.

 Source code of R module reps <- as.numeric(par1) ssize <- as.numeric(par2) m <- as.numeric(par3) s <- as.numeric(par4) samples <- FALSE my.dotplot.lims <- function (x, at=.44, cex=1, x.min=x.min, x.max=x.max ,scale=10, ...){ z=(x-mean(x))/sd(x) z=(round(scale*z)/scale) x=z*sd(x)+mean(x) edge=(x.max-x.min)/10 stripchart(x,method="stack", xlim=c(x.min-edge, x.max+edge), ylab="Frequency", at=at, cex=cex,...) } means=1:reps for (i in 1:reps) { sample=rnorm(ssize,m,s) mean=mean(sample) if (samples==T) { print(c("Sample Number",i)) print(format(sample,digits=1)) print (c("Mean of Sample Number",i,format(mean,digits=1)))} means[i]=mean } bitmap(file="test1.png") my.dotplot.lims(sample, x.min=m-2.5*s, x.max=m+2.5*s, scale=10/ssize^.5, main="typical sample vs population density", col="darkgreen", xlab="sample values") text(-2.2,1.5,"Sample Size =",col="darkgreen") text(-1,1.5,ssize) x=seq(m-2.5*s,m+2.5*s,length.out=25) lines(x,.4+dnorm(x,mean=m,sd=s),col="red",lwd=2) lines(x,x/x-.6,col="black") dev.off() bitmap(file="test2.png") my.dotplot.lims(means, x.min=m-2.5*s, x.max=m+2.5*s, scale=10/ssize^.5, main="Sampling Distribution of the Sample Mean", xlab="sample means",col="darkgreen") text(-2.2,1.5,"Sample Size =",col="darkgreen") text(-1,1.5,ssize) text(-3.0,1.35,reps) text(-1.8,1.35,"Sample Means",col="darkgreen") x=seq(m-2.5*s,m+2.5*s,length.out=25) lines(x,.4+dnorm(x,mean=m,sd=s),col="red",lwd=2) lines(x,x/x-.6,col="black") text(2,.8,"Population Density",col="red") dev.off()
 Top | Output | Charts | References | History | Feedback

 Cite this software as: Weldon L., (2008), Sampling Distribution of the Sample Mean (v1.0.0) in Free Statistics Software (v1.1.23-r7), Office for Research Development and Education, URL http://www.wessa.net/rwasp_samplingdistributionmean.wasp/ The R code is based on : Weldon Larry, Stat Ed Programs for Demos in R, Simon Fraser University, URL http://www.stat.sfu.ca/~weldon/title.doc Weldon Larry, R Programs for Statistics Education, Simon Fraser University, URL http://www.stat.sfu.ca/~weldon/Programs Weldon Larry, Instructions for using R programs for Statistics Education, Simon Fraser University, URL http://www.stat.sfu.ca/~weldon/instructions.doc
 Top | Output | Charts | References | History | Feedback
 Top | Output | Charts | References | History | Feedback