WOLFRAM|DEMONSTRATIONS PROJECT

Robustness of Student t in the One-Sample Problem

​
random seed
212
sample size, n
30
distribution
normal
uniform
Laplace
exponential
method
Z
t

0.9
0.95
0.99
Level
C
confidence intervals and
p
-values are shown for 100 simple random samples of size
n
drawn from the specified population with mean
μ=0
and standard deviation
σ=1
. The
Z
and
t
methods are compared for calculating the confidence intervals and
p
-values. The
Z
method is based on the normal distribution using the estimated standard deviation in place of the unknown
σ
. The
Z
method is approximately valid for
n
large enough for all distributions considered in this Demonstration. The
t
method uses the Student
t
-distribution with
n-1
degrees of freedom; it is exact in the case of the normal distribution and is approximate for the other distributions considered in this Demonstration.
Corresponding to each confidence level for
μ
, the two-sided
p
-value in the test of the null hypothesis (that the true mean equals 0) is shown to the right. These
p
-values are uniformly distributed between 0 and 1 in the normal case using the
t
method, and approximately so in the other cases.
It is interesting to do about 10,000 or more simulations to see how quickly the estimates

C
and

α
converge. To do this, click the icon beside the random seed slider, set the animation speed slower, and click the play button. Allow it to run for ten seconds or so.
This Demonstration can be used to show that the
Z
-test is not conservative in small samples. It also illustrates the random coverage probability of confidence intervals and the random distribution
p
-values. Finally, the robustness of
t
methods can be investigated for various non-normal distributions. See the Details for further discussion.