Solutions for some HW problems

(Note: Some HW solutions may be distributed in paper form.)

Below are solutions for

Exercise 1

Under the null hypothesis, there are 2n sets of ranks which are equally likely to be summed to produce the value of T+. There are 10 sets listed above, and so the size of the test is 10/2n = 5/2n-1.



Exercise 2

We have that talpha/2 = [n(n+1)] - 1, and so the lower confidence bound is W2 and the upper confidence bound is W([n[n+1)/2]-1), where, as in the text, W(j) denotes the jth Walsh average in the ordered sequence. W(1) = (Z(1) + Z(1))/2, and W(2) = (Z(1) + Z(2))/2. Similarly, W([n(n+1)/2] - 1) = (Z(n-1) + Z(n))/2. So the length of the confidence interval is (Z(n-1) + Z(n))/2 - (Z(1) + Z(2))/2 = (Z(n) + Z(n-1) - Z(2) - Z(1))/2.



Exercise 4

I'll explain how to obtain the answer w/o using StatXact.

Using the midrank method, the five scores are:
s1 = 2, s2 = 2, s3 = 2, s4 = 4.5, s5 = 4.5.
If the null hypothesis is true, each of the five scores contributes to the value of T+ with probability 1/2, independent of which other scores contribute to the value of the test statistic. So the following 32 subsets of scores are equally likely to contribute to the test statistic if the null hypothesis is true.

{ } (sum of scores is 0)
{s1 = 2} (sum of scores is 2)
{s2 = 2} (sum of scores is 2)
{s3 = 2} (sum of scores is 2)
{s4 = 4.5} (sum of scores is 4.5)
{s5 = 4.5} (sum of scores is 4.5)
{ s1 = 2, s2 = 2} (sum of scores is 4)
{ s1 = 2, s3 = 2} (sum of scores is 4)
{ s1 = 2, s4 = 4.5} (sum of scores is 6.5)
{ s1 = 2, s5 = 4.5} (sum of scores is 6.5)
{ s2 = 2, s3 = 2} (sum of scores is 4)
{ s2 = 2, s4 = 4.5} (sum of scores is 6.5)
{ s2 = 2, s5 = 4.5} (sum of scores is 6.5)
{ s3 = 2, s4 = 4.5} (sum of scores is 6.5)
{ s3 = 2, s5 = 4.5} (sum of scores is 6.5)
{ s4 = 4.5, s5 = 4.5} (sum of scores is 9)
{ s1 = 2, s2 = 2, s3 = 2} (sum of scores is 6}
{ s1 = 2, s2 = 2, s4 = 4.5} (sum of scores is 8.5)
{ s1 = 2, s2 = 2, s5 = 4.5} (sum of scores is 8.5)
{ s1 = 2, s3 = 2, s4 = 4.5} (sum of scores is 8.5)
{ s1 = 2, s3 = 2, s5 = 4.5} (sum of scores is 8.5)
{ s1 = 2, s4 = 4.5, s5 = 4.5} (sum of scores is 11)
{ s2 = 2, s3 = 2, s4 = 4.5} (sum of scores is 8.5)
{ s2 = 2, s3 = 2, s5 = 4.5} (sum of scores is 8.5)
{ s2 = 2, s4 = 4.5, s5 = 4.5} (sum of scores is 11)
{ s3 = 2, s4 = 4.5, s5 = 4.5} (sum of scores is 11)
{ s1 = 2, s2 = 2, s3 = 2, s4 = 4.5} (sum of scores is 10.5)
{ s1 = 2, s2 = 2, s3 = 2, s5 = 4.5} (sum of scores is 10.5)
{ s1 = 2, s2 = 2, s4 = 4.5, s5 = 4.5} (sum of scores is 13)
{ s1 = 2, s3 = 2, s4 = 4.5, s5 = 4.5} (sum of scores is 13)
{ s2 = 2, s3 = 2, s4 = 4.5, s5 = 4.5} (sum of scores is 13)
{ s1 = 2, s2 = 2, s3 = 2, s4 = 4.5, s5 = 4.5} (sum of scores is 15)
It follows from above that
P0(T+ = 0) = 1/32,
P0(T+ = 2) = 3/32,
P0(T+ = 4) = 3/32,
P0(T+ = 4.5) = 2/32,
P0(T+ = 6) = 1/32,
P0(T+ = 6.5) = 6/32,
P0(T+ = 8.5) = 6/32,
P0(T+ = 9) = 1/32,
P0(T+ = 10.5) = 2/32,
P0(T+ = 11) = 3/32,
P0(T+ = 13) = 3/32,
P0(T+ = 15) = 1/32,
(Note: It's not necessary to determine the entire null sampling distribution to obtain the p-value --- one could just figure out that only 4 of the 32 subsets of scores yield a value of the test statistic at least as large as the observed value of the test statistic. But since you'll be making use of StatXact a lot, I think it's a good idea to determine an exact sampling distribution based on midranks at least one time.) Since the observed value of the test statistic is 13,
the exact p-value is P0(T+ >= 13) = 4/32 = 0.125.

Using Table A.4, the
the "incorrect p-value" is about 0.094.

Breaking ties conservatively, -1.3 gets assigned rank 3, and the two values of 1.3 get assigned ranks 1 and 2. The positive values also get assigned ranks 4 and 5, and so the conservative value of the test statistic is 1 + 2 + 4 + 5 = 12. (Note: When applying the conservative procedure, the point is to use each rank from {1, 2, ..., n} exactly one time, so that the ranks used are those that correspond to the tabulated null distribution.) So, from Table A.4,
the conservative p-value is about 0.156.


Exercise 5

The are: Upon applying the randomization, we have that: It follows that the expected value of the random p-value is about 0.119.



Exercise 6

Letting Y be the number of observations in a random sample of size 12 that will exceed 20, the desired p-value is
P0(Y <= 2) = 0.0000376,
where the probability follows from the fact that the null sampling distribution of Y is binomial (12, 0.75). (Alternatively, one can let p be the probability that an observation will be less than or equal to 20 and test the null hypothesis that p <= 0.25 against the alternative that p > 0.25. The p-value is P(W >= 10), where W is a binomial (12, 0.25) random variable.)



Exercise 7

Since f(0) = 0, the ARE of the sign test with respect to the t test is 0 (from (3.117) on p. 105 of H&W). (Note: For unimodal symmetric distributions, the ARE is greater than or equal to 1/3, but that lower bound doesn't apply to the bimodal density dealt with here.)

Since the distribution mean is 0 (by symmetry), the variance is just the 2nd moment, which equals c2/2. The integral of the squared density is 2/(3c), and from (3.115) on p. 104 of H&W it follows that the ARE of the signed-rank test with respect to the t test is 8/3.



Exercise 8

Letting Y be the number of observations in a random sample of size 12 that will exceed 15, the desired p-value is
P0(Y >= 12) = 0.28,
where the probability follows from the fact that the null sampling distribution of Y is binomial (12, 0.9). (Alternatively, one can let p be the probability that an observation will be less than or equal to 15 and test the null hypothesis that p >= 0.1 against the alternative that p < 0.1. The p-value is P(W <= 0), where W is a binomial (12, 0.1) random variable.)



Exercise 9

Some people went wrong on this one because they seemed to assume that the differences are uniformly distributed on (c, -c), which is not the case! One needs to determine that the proper pdf to deal with for the differences is a triangular pdf. It has support (c, -c), but the distribution is not a uniform distribution. (To sketch the nonzero part of the pdf, just connect the points (-c, 0), (0, 1/c), and (c, 0). (To derive the pdf, one would just use techniques covered in STAT 544 (or even STAT 344, the way I used to teach it).))

Exercise 10

The intention was for you to use StatXact to do most of the work for this exercise. For parts (a), (b), and (e), one could have just entered the two columns of data values into two columns/variables on the CaseData spreadsheet, and then use the Sign, Wilcoxon Signed Rank, and Permutation tests from the Paired Samples portion of the Statistics menu, entering the variables into the boxes for Population 1 and Population 2 (as opposed to using the Use Differences option).

But since StatXact doesn't have a normal scores test for paired data, one needs to make use of the paired samples permutation test to do the exact normal scores test. To do this, one can enter the signed normal scores into a column on the CaseData sheet, and then use this column/variable with the permutation test, choosing the Use Differences option. The output also gives the asymptotic result requested for part (d) (although I think it would have been nice for you to obtain the part (d) result some other way in order to get a better feel for the test, and to also check your use of StatXact).

A complication arises with the normal scores test due to ties. Since the ties only occur with either two positive values or two negative values, one scheme would be to not use midranks and assume that if measurements had been made more preceisely, there would have been no ties. So, for example, if a tie situation is encountered when assigning the 4th score, and it is noted that both the 4th and 5th values, which are tied in magnitude, also have the same sign, then instead of assigning each value the average of the 4th and 5th scores, one could just assign one difference the 4th score and the other the 5th score. (Note: This wouldn't be good if one difference was positive and the other negative.) Doing it this way, the signed scores to be entered into a column of StatXact are the values given below. If one uses midranks, then four pairs of scores are replaced by midranks. The midrank adjusted scores are given below, and these could have been entered into a column/variable of the CaseData sheet. Whichever set of scores one uses, the p-values are the same when rounded to two significant digits. (The standardized test statistic (z-score) used for the approximate test has a value of about -2.41 with both sets of scores.)

The desired p-values are given below.

(a) 0.12

(b) 0.014

(c) 0.012

(d) 0.016

(e) 0.012



Exercise 11

The desired p-values are given below.

(a) 0.075

(b) 0.067

(c) 0.12

(d) 0.10

(e) 0.23



Exercise 12

A B
W-M-W 0.17 0.083
normal scores 0.18 0.090
Savage scores 0.059 0.029
median 0.18 0.089
permutation 0.040 0.020
S-T 0.12 X
A-B 0.15 X
Klotz 0.073 X
Mood 0.080 X
Conover 0.000011 X
Lepage 0.11 X
p. 157 0.24 X
K-S 0.17 0.084
W-W 0.24 X
jackknife 0.000098 X
(Note that some of the more exotic tests produce p-values that are much smaller than those produced by some of the more commonly used tests.)



Exercise 13

When one pairs the ten observations in each sample according to the pattern (1,2), (3,4), ..., (9,10), then whether one uses integer ranks or the squares of integers as the scores, the p-value is about 0.0079. (Just for fun, I tried some other pairings. When one pairs the ten observations in each sample according to the pattern (1,6), (2,7), ..., (5,10), or according to the pattern (1,10), (2,9), ..., (5,6), using integer ranks produces a p-value of about 0.056, and using the squares of integers as the scores produces a p-value of about 0.040. So a bad thing about the little test I proposed is that the p-value obtained may depend on how one does the pairing.)



Exercise 14

p-value
(a) 0.000010
(b) 0.000036
(c) 0.0017
(d) 0.0011
(e) 0.000020
(f) 0.00069
(g) 0.0000010
(h) 0.0035
(i) 0.000070
(For part (i), we have If a continuity correction is used, the z-score is 3.77781. The continuity correction will make the approximate p-value larger, in our case it's about 0.000079. (Be careful not to put the continuity correction in the wrong way.))



Exercise 15

A
(a) 0.00035
(b) 0.000078
(Note: For part (b), most of you got 0.000078 because you followed my incomplete instructions for how to do the test using StatXact. (I had forgot to put in that the "raw" data values had to be replaced by (mid)ranks, and so if you followed my instructions you did a permutation version of the test, instead of a test based on the ranks. I now have corrected my instructions for doing the desired test using StatXact.))



Exercise 16

w/o c.c. w/ c.c.
(a) 0.087 0.092
(b) 0.042 0.045
(c) 0.0095 0.010
(We have (Note that the continuity correction will make the approximate p-value larger. Be careful not to put the continuity correction in the wrong way.))



Exercise 17

StatXact can be used to obtain that the values corresponding to the square brackets in (6.62) on p. 241 are Upon multiplying the largest (in absolute value) of these by the square root of 2, one obtains that the value of the test statistic is 2.60060. Comparing this value to the appropriate critical values, one can obtain that we have 0.1 < p-value < 0.2.



Exercise 18

Making use of the nifty formulas for the sum of the first m integers, and the sum of the squares of the first m integers, and rearranging terms and factoring, it can be shown that the desired constant equals n(n + 1)(2n + 1)(k - 1)k(k + 1)/72.



Exercise 19

probability
(a) 2/36
(b) 15/36
(c) 6/36
(d) 6/36
(e) 6/36



Exercise 20

test stat. p-value
(a) 4.67 0.194
(b) 7 0.194
(c) 5 0.194
(d) 8.24 0.0102 < p-value < 0.0497
(e) 3.76 0.01 < p-value < 0.025
(f) 7.08 0.0102 < p-value < 0.0497
(g) 4 0.135



Exercise 21

test stat. p-value
(a) 109 0.000353
(b) 3.07 0.00106
(c) 13 0.0007



Exercise 22

test stat. p-value
(a) 19.8 0.0110
(b) 4.62 0.025 < p-value < 0.05