01.03.2013 Views

Applied Statistics Using SPSS, STATISTICA, MATLAB and R

Applied Statistics Using SPSS, STATISTICA, MATLAB and R

Applied Statistics Using SPSS, STATISTICA, MATLAB and R

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

134 4 Parametric Tests of Hypotheses<br />

iii. Studies of preference of a product, depending on sex, are sometimes<br />

performed in a “paired samples” approach, e.g. by pairing the enquiry<br />

results of the husb<strong>and</strong> with those of the wife. The rationale being that<br />

husb<strong>and</strong> <strong>and</strong> wife have similar ratings in what concerns influential factors<br />

such as degree of education, environment, age, reading habits, etc.<br />

Naturally, this assumption could be controversial.<br />

Note that when performing tests with <strong>SPSS</strong> or <strong>STATISTICA</strong> for independent<br />

samples, one must have a datasheet column for the grouping variable that<br />

distinguishes the independent samples (groups). The grouping variable uses<br />

nominal codes (e.g. natural numbers) for that distinction. For paired samples, such<br />

a column does not exist because the variables to be tested are paired for each case.<br />

4.4.3.2 Testing Means on Independent Samples<br />

When two independent r<strong>and</strong>om variables XA <strong>and</strong> XB are normally distributed, as<br />

N µ A ,σ <strong>and</strong> N<br />

A<br />

µ B ,σ respectively, then the variable X<br />

B<br />

A − X B has a normal<br />

distribution with mean µA – µB <strong>and</strong> variance given by:<br />

2<br />

A<br />

A<br />

2<br />

B<br />

2 σ σ<br />

σ = + . 4.11<br />

n n<br />

B<br />

where nA <strong>and</strong> nB are the sizes of the samples with means x A <strong>and</strong> x B , respectively.<br />

Thus, when the variances are known, one can perform a comparison of two means<br />

much in the same way as in sections 4.1 <strong>and</strong> 4.2.<br />

Usually the true values of the variances are unknown; therefore, one must apply<br />

a Student’s t distribution. This is exactly what is assumed by <strong>SPSS</strong>, <strong>STATISTICA</strong>,<br />

<strong>MATLAB</strong> <strong>and</strong> R.<br />

Two situations must now be considered:<br />

1 – The variances σA <strong>and</strong> σB can be assumed to be equal.<br />

Then, the following test statistic:<br />

t<br />

*<br />

xA<br />

− xB<br />

= , 4.12<br />

v p v p<br />

+<br />

n n<br />

A<br />

B<br />

where v p is the pooled variance computed as in formula 4.9, has a Student’s t<br />

distribution with the following degrees of freedom:<br />

df = nA + nB – 2. 4.13<br />

2 – The variances σA <strong>and</strong> σB are unequal.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!