3.6 THE T-TEST 61
3 UNIVARIATE STATISTICS
clear
x = 9 : 0.1 : 15;
pdf = normpdf(x,12.3448,1.1660);
cdf = normcdf(x,12.3448,1.1660);
plot(x,pdf,x,cdf)
MATLAB also provides a GUI-based function for generating PDFs and
CDFs with speci c statistics, which is called
disttool.
disttool
We choose PDF as function type and, then de ne the mean as Mu=12.3448
and the standard deviation as
Sigma=1.1660. Although the function
disttool is GUI-based, it uses the non-GUI functions for calculating
probability density functions and cumulative distribution functions, such
as
normpdf and normcdf.
e remaining sections in this chapter are concerned with methods of
drawing conclusions from the sample that can then applied to the larger
phenomenon of interest ( hypothesis testing). e three most important sta-
tistical tests for earth science applications are introduced, these being the
two-sample t-test to compare the means of two data sets, the two-sample
F-test to compare the variances of two data sets, and the χ
2
-test to compare
distributions. e last section introduces methods that can be used to t
distributions to our data sets.
3.6 The t-Test
e Student’s t-test by William Gossett compares the means of two distri-
butions. e one-sample t-test is used to test the hypothesis that the mean
of a Gaussian-distributed population has a value speci ed in the null hy-
pothesis. e two-sample t-test is employed to test the hypothesis that the
means of two Gaussian distributions are identical. In the following text, the
two-sample t-test is introduced to demonstrate hypothesis testing. Let us
assume that two independent sets of n
a
and n
b
measurements have been
carried out on the same object, for instance, measurements on two sets of
rock samples taken from two separate outcrops. e t-test can be used to de-
termine whether both sets of samples come from the same population, e. g.,
the same lithologic unit ( null hypothesis) or from two di erent populations
( alternative hypothesis). Both sample distributions must be Gaussian, and
the variance for the two sets of measurements should be similar. e appro-
priate test statistic for the di erence between the two means is then