Robert_V._Hogg,_Joseph_W._McKean,_Allen_T._Craig

(Jacob Rumans) #1
10.2. Sample Median and the Sign Test 573

whereε 1 ,ε 2 ,...,εnare iid with cdfF(x), pdff(x), and median 0. Note that in
terms of Section 10.1, the location functional is the median and, hence,θis the
median ofXi. We begin with a test for the one-sided hypotheses


H 0 :θ=θ 0 versusH 1 : θ>θ 0. (10.2.2)

Consider the statistic
S(θ 0 )=#{Xi>θ 0 }, (10.2.3)


which is called thesign statisticbecause it counts the number of positive signs in
the differencesXi−θ 0 ,i=1, 2 ,...,n. If we defineI(x>a) to be 1 or 0 depending
on whetherx>aorx≤a, then we can expressS(θ 0 )as


S(θ 0 )=

∑n

i=1

I(Xi>θ 0 ). (10.2.4)

Note that ifH 0 is true, then we expect one half of the observations to exceedθ 0 ,
while ifH 1 is true, we expect more than half of the observations to exceedθ 0.
Consider then the test of the hypotheses (10.2.2) given by


RejectH 0 in favor ofH 1 ifS(θ 0 )≥c. (10.2.5)

Under the null hypothesis, the random variablesI(Xi>θ 0 ) are iid with a Bernoulli
b(1, 1 /2) distribution. Hence the null distribution ofS(θ 0 )isb(n, 1 /2) with mean
n/2andvariancen/4. Note that underH 0 , the sign test does not depend on the
distribution ofXi. In general, we call such a test adistribution freetest.
For a levelαtest, selectcto becα,wherecαis the upperαcritical point of a bi-
nomialb(n, 1 /2) distribution. The test statistic, though, has a discrete distribution,
so for an exact test there are only a finite number of levelsαavailable. The values
ofcαare easily found by most computer packages. For instance, the R command
pbinom(0:15,15,.5)returns the cdf of a binomial distribution withn=15and
p=0.5, from which all possible levels can be seen.
For a given data set, thep-value associated with the sign test is given byp̂=
PH 0 (S(θ 0 )≥s), wheresis the realized value ofS(θ 0 ) based on the sample. For
computation, the R command1 - pbinom(s-1,n,.5)computesp̂.
It is convenient at times to use a large sample test based on the asymptotic
distribution of the test statistic. By the Central Limit Theorem, underH 0 the stan-
dardized statistic [S(θ 0 )−(n/2)]/



n/2 is asymptotically normal,N(0,1). Hence
the large sample test rejectsH 0 if

S(θ 0 )−(n/2)

n/ 2

≥zα; (10.2.6)

see Exercise 10.2.2.
We briefly touch on the two-sided hypotheses given by


H 0 :θ=θ 0 versusH 1 : θ =θ 0. (10.2.7)
Free download pdf