Page 154 - Applied Statistics Using SPSS, STATISTICA, MATLAB and R
P. 154
134 4 Parametric Tests of Hypotheses
iii. Studies of preference of a product, depending on sex, are sometimes
performed in a “paired samples” approach, e.g. by pairing the enquiry
results of the husband with those of the wife. The rationale being that
husband and wife have similar ratings in what concerns influential factors
such as degree of education, environment, age, reading habits, etc.
Naturally, this assumption could be controversial.
Note that when performing tests with SPSS or STATISTICA for independent
samples, one must have a datasheet column for the grouping variable that
distinguishes the independent samples (groups). The grouping variable uses
nominal codes (e.g. natural numbers) for that distinction. For paired samples, such
a column does not exist because the variables to be tested are paired for each case.
4.4.3.2 Testing Means on Independent Samples
When two independent random variables X A and X B are normally distributed, as
N µ A ,σ and N µ B ,σ respectively, then the variable X A − X has a normal
B
B
A
distribution with mean µ A – µ B and variance given by:
σ 2 σ 2
σ 2 = A + B . 4.11
n A n B
where n A and n B are the sizes of the samples with means x and x , respectively.
A
B
Thus, when the variances are known, one can perform a comparison of two means
much in the same way as in sections 4.1 and 4.2.
Usually the true values of the variances are unknown; therefore, one must apply
a Student’s t distribution. This is exactly what is assumed by SPSS, STATISTICA,
MATLAB and R.
Two situations must now be considered:
1 – The variances σ A and σ B can be assumed to be equal.
Then, the following test statistic:
x − x
*
t = A B , 4.12
v p v p
n A + n B
where v is the pooled variance computed as in formula 4.9, has a Student’s t
p
distribution with the following degrees of freedom:
df = n A + n B – 2. 4.13
2 – The variances σ A and σ B are unequal.