sample statistics for samples from a normal distribution

Print["A parent population"]
Plot[PDF[NormalDistribution[0,1],x],{x,-3,3}]

detail

Clear[nSize,i,numSets,SampleMeans,SampleStDevs,SampleMaxs,plts]
nSize=10;
numSets=4;
SampleMeans={};
SampleStDevs={};
SampleMaxs={};
For[i=1,i≤ numSets,i++,
SampleSets[i] = RandomReal[NormalDistribution[0,1],nSize];
plts[i] = Histogram[SampleSets[i],Automatic,"Probability"];
AppendTo[SampleMeans, Mean[SampleSets[i]] ];
AppendTo[SampleStDevs, StandardDeviation[SampleSets[i]]  ];
AppendTo[SampleMaxs, Max[SampleSets[i]] ]
]
Print["A sample should resemble its parent population."]
Print["Samples vary, especially for a small sample size!"]
Print[GraphicsArray[       Table[plts[i],{i,1,numSets}] ]   ]
Print["Each sample has some summary statistics. We collect a single statistic from all samples. "]
Print["collection of xbar: ",SampleMeans]
Print["collection of s: ",SampleStDevs]
Print["collection of max: ",SampleMaxs]

Clear[nSize,i,numSets,SampleMeans,SampleStDevs,SampleMaxs,plts]
nSize=50;
numSets=4;
SampleMeans={};
SampleStDevs={};
SampleMaxs={};
For[i=1,i≤ numSets,i++,
SampleSets[i] = RandomReal[NormalDistribution[0,1],nSize];
plts[i] = Histogram[SampleSets[i],Automatic,"Probability"];
AppendTo[SampleMeans, Mean[SampleSets[i]] ];
AppendTo[SampleStDevs, StandardDeviation[SampleSets[i]]  ];
AppendTo[SampleMaxs, Max[SampleSets[i]] ]
]
Print["A sample should resemble its parent population."]
Print["Samples vary, even for a moderate sample size"]
Print[GraphicsArray[       Table[plts[i],{i,1,numSets}] ]   ]
Print["Each sample has some summary statistics. We collect a single statistic from all samples. "]
Print["collection of xbar: ",SampleMeans]
Print["collection of s: ",SampleStDevs]
Print["collection of max: ",SampleMaxs]

Clear[nSize,i,numSets,SampleMeans,SampleStDevs,SampleMaxs,plts]
nSize=500;
numSets=4;
SampleMeans={};
SampleStDevs={};
SampleMaxs={};
For[i=1,i≤ numSets,i++,
SampleSets[i] = RandomReal[NormalDistribution[0,1],nSize];
plts[i] = Histogram[SampleSets[i],Automatic,"Probability"];
AppendTo[SampleMeans, Mean[SampleSets[i]] ];
AppendTo[SampleStDevs, StandardDeviation[SampleSets[i]]  ];
AppendTo[SampleMaxs, Max[SampleSets[i]] ]
]
Print["A sample should resemble its parent population."]
Print["Samples vary, even for a large sample size!"]
Print[GraphicsArray[       Table[plts[i],{i,1,numSets}] ]   ]
Print["Each sample has some summary statistics. We collect a single statistic from all samples. "]
Print["collection of xbar: ",SampleMeans]
Print["collection of s: ",SampleStDevs]
Print["collection of max: ",SampleMaxs]

COLLECT SAMPLES STATISTICS FROM MULTIPLE RANDOM SAMPLES OF THE SAME SIZE

Clear[nSize,i,j,k, numSamplesPerRow,numRows,numSamples,SampleMeans,SampleStDevs,SampleMaxs,plts]
nSize=100;
numSamplesPerRow=5;
numRows=10;
SampleMeans={};
SampleStDevs={};
SampleMaxs={};
For[j=1,j≤ numRows,j++,
For[i=1,i≤ numSamplesPerRow,i++,
SampleSets[j,i] = RandomReal[NormalDistribution[0,1],nSize];
plts[j,i] = Histogram[SampleSets[j,i],Automatic,"Probability"];
AppendTo[SampleMeans, Mean[SampleSets[j,i]] ];
AppendTo[SampleStDevs, StandardDeviation[SampleSets[j,i]]  ];
AppendTo[SampleMaxs, Max[SampleSets[j,i]] ]
]
Print[GraphicsArray[       Table[plts[j,k],{k,1,numSetsPerRow}] ]   ]
]
numSamples = numSamplesPerRow * numRows; 
Print["There are ", numSamples, " samples of size ", nSize]

Print["Collect the sample means from these samples; show a histogram of sample means."]
Print["The histogram shows ",numSamples, " sample means."]
Print["These are from a new population of all possible sample means for samples of size ", nSize]
Print[SampleMeans]
Histogram[SampleMeans,Automatic,"Probability"]

Print["Collect the sample standard deviations from these samples; show a histogram of sample standard deviations."]
Print["The histogram shows ",numSamples, " sample standard deviations."]
Print["These are from a new population of all possible sample standard deviations for samples of size ", nSize]
Print[SampleStDevs]
Histogram[SampleStDevs,Automatic,"Probability"]

Print["Collect the sample maxs from these samples; show a histogram of sample maxs."]
Print["The histogram shows ",numSamples, " sample maxs."]
Print["These are from a new population of all possible sample maxs for samples of size ", nSize]
Print[SampleMaxs]
Histogram[SampleMaxs,Automatic,"Probability"]

sample statistics for samples from an exponential distribution

Print["A parent population"]
Plot[PDF[ExponentialDistribution[1],x],{x,0,5}]

COLLECT SAMPLES STATISTICS FROM MULTIPLE RANDOM SAMPLES OF THE SAME SIZE

Clear[nSize,i,j,k, numSamplesPerRow,numRows,numSamples,SampleMeans,SampleStDevs,SampleMaxs,plts]
nSize=100;
numSamplesPerRow=5;
numRows=10;
SampleMeans={};
SampleStDevs={};
SampleMaxs={};
For[j=1,j≤ numRows,j++,
For[i=1,i≤ numSamplesPerRow,i++,
SampleSets[j,i] = RandomReal[ExponentialDistribution[1],nSize];
plts[j,i] = Histogram[SampleSets[j,i],Automatic,"Probability"];
AppendTo[SampleMeans, Mean[SampleSets[j,i]] ];
AppendTo[SampleStDevs, StandardDeviation[SampleSets[j,i]]  ];
AppendTo[SampleMaxs, Max[SampleSets[j,i]] ]
]
Print[GraphicsArray[       Table[plts[j,k],{k,1,numSetsPerRow}] ]   ]
]
numSamples = numSamplesPerRow * numRows; 
Print["There are ", numSamples, " samples of size ", nSize]

Print["Collect the sample means from these samples; show a histogram of sample means."]
Print["The histogram shows ",numSamples, " sample means."]
Print["These are from a new population of all possible sample means for samples of size ", nSize]
Print[SampleMeans]
Histogram[SampleMeans,Automatic,"Probability"]

Print["Collect the sample standard deviations from these samples; show a histogram of sample standard deviations."]
Print["The histogram shows ",numSamples, " sample standard deviations."]
Print["These are from a new population of all possible sample standard deviations for samples of size ", nSize]
Print[SampleStDevs]
Histogram[SampleStDevs,Automatic,"Probability"]

Print["Collect the sample maxs from these samples; show a histogram of sample maxs."]
Print["The histogram shows ",numSamples, " sample maxs."]
Print["These are from a new population of all possible sample maxs for samples of size ", nSize]
Print[SampleMaxs]
Histogram[SampleMaxs,Automatic,"Probability"]

sample statistics for samples from a uniform distribution

Print["A parent population"]
Plot[PDF[UniformDistribution[{2,5}],x],{x,0,7},PlotStyle->{Red,Thick}]

COLLECT SAMPLES STATISTICS FROM MULTIPLE RANDOM SAMPLES OF THE SAME SIZE

Clear[nSize,i,j,k, numSamplesPerRow,numRows,numSamples,SampleMeans,SampleStDevs,SampleMaxs,plts]
nSize=100;
numSamplesPerRow=5;
numRows=10;
SampleMeans={};
SampleStDevs={};
SampleMaxs={};
For[j=1,j≤ numRows,j++,
For[i=1,i≤ numSamplesPerRow,i++,
SampleSets[j,i] = RandomReal[UniformDistribution[{2,5}],nSize];
plts[j,i] = Histogram[SampleSets[j,i],Automatic,"Probability"];
AppendTo[SampleMeans, Mean[SampleSets[j,i]] ];
AppendTo[SampleStDevs, StandardDeviation[SampleSets[j,i]]  ];
AppendTo[SampleMaxs, Max[SampleSets[j,i]] ]
]
Print[GraphicsArray[       Table[plts[j,k],{k,1,numSetsPerRow}] ]   ]
]
numSamples = numSamplesPerRow * numRows; 
Print["There are ", numSamples, " samples of size ", nSize]

Print["Collect the sample means from these samples; show a histogram of sample means."]
Print["The histogram shows ",numSamples, " sample means."]
Print["These are from a new population of all possible sample means for samples of size ", nSize]
Print[SampleMeans]
Histogram[SampleMeans,Automatic,"Probability"]

Print["Collect the sample standard deviations from these samples; show a histogram of sample standard deviations."]
Print["The histogram shows ",numSamples, " sample standard deviations."]
Print["These are from a new population of all possible sample standard deviations for samples of size ", nSize]
Print[SampleStDevs]
Histogram[SampleStDevs,Automatic,"Probability"]

Print["Collect the sample maxs from these samples; show a histogram of sample maxs."]
Print["The histogram shows ",numSamples, " sample maxs."]
Print["These are from a new population of all possible sample maxs for samples of size ", nSize]
Print[SampleMaxs]
Histogram[SampleMaxs,Automatic,"Probability"]