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.

206 5 Non-Parametric Tests of Hypotheses<br />

H0: After the treatment, P(+ → –) = P(– → +);<br />

H1: After the treatment, P(+ → –) ≠ P(– → +).<br />

Let us use a 2×2 table for recording the before <strong>and</strong> after situations, as shown in<br />

Figure 5.5. We see that a change occurs in situations A <strong>and</strong> D, i.e., the number of<br />

cases which change of response is A + D. If both changes of response are equally<br />

likely, the expected count in both cells is (A + D)/2.<br />

The McNemar test uses the following test statistic:<br />

2<br />

2<br />

2<br />

* 2 ( O i − Ei<br />

)<br />

χ = ∑<br />

i= 1 Ei<br />

⎡ A + D ⎤<br />

⎢A<br />

− ⎥<br />

⎣ 2 ⎦<br />

=<br />

A + D<br />

⎡ A + D ⎤<br />

⎢D<br />

− ⎥<br />

⎣ 2 ⎦<br />

+<br />

A + D<br />

2<br />

( A − D)<br />

= .<br />

A + D<br />

5.34<br />

2<br />

2<br />

The sampling distribution of this test statistic, when the null hypothesis is true,<br />

is asymptotically the chi-square distribution with df = 1. A continuity correction is<br />

often used, especially for small absolute frequencies, in order to make the<br />

computation of significances more accurate.<br />

An alternative to using the chi-square test is to use the binomial test. One would<br />

then consider the sample with n = A + D cases, <strong>and</strong> assess the null hypothesis that<br />

the probabilities of both changes are equal to ½.<br />

+<br />

Before<br />

After<br />

+<br />

A B<br />

C D<br />

Figure 5.5. Table for the McNemar change test, where A, B, C <strong>and</strong> D are cell<br />

counts.<br />

Example 5.16<br />

Q: Consider that in an enquiry into consumer preferences of two products A <strong>and</strong> B,<br />

a group of 57 out of 160 persons preferred product A, before reading a study of a<br />

consumer protection organisation. After reading the study, 8 persons that had<br />

preferred product A <strong>and</strong> 21 persons that had preferred product B changed opinion.<br />

Is it possible to accept, at a 5% level, that the change of opinion was due to hazard?<br />

A: Table 5.21a shows the respective data in a convenient format for analysis with<br />

<strong>STATISTICA</strong> or <strong>SPSS</strong>. The column “Number” should be used for weighing the<br />

cases corresponding to the cells of Figure 5.5 with “1” denoting product A <strong>and</strong> “2”<br />

denoting product B. Case weighing was already used in section 5.1.2.<br />

2

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

Saved successfully!

Ooh no, something went wrong!