Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 13 The Quantile Test

Similar presentations


Presentation on theme: "Lecture 13 The Quantile Test"— Presentation transcript:

1 Lecture 13 The Quantile Test
Outline of Today The Quantile Test CI for Quantiles The Quantile Test for Large Samples The Sign Test for Median 11/19/2018 SA3202, Lecture 13

2 The Quantile Test Definition The quantile test is a test about whether a quantile is equal to, or smaller, or larger than a given value given a random sample from a continuous but unknown distribution function. 11/19/2018 SA3202, Lecture 13

3 Testing Procedure The quantile test can be converted to hypothesis test about a binomial parameter, and therefore, can be tested using a binomial test. Let U be the number of observations which are less than or equal to a, U=#{Xi | Xi<= a} Then considering the event “ the observation is less than or equal to a” as “ Success”, it follows that U~Binom(n, p), p= Now, clearly, we have the following relationship: 11/19/2018 SA3202, Lecture 13

4 Remark Note that the apparent reversal in the direction of the equality. This follows from the fact that Thus, the hypotheses about the quantile are equivalent to hypotheses about the parameter of a binomial distribution U~Binom(n,p), and may be tested in a usual manner. For example, testing ” H0: xp0=a against H1: xp0<a “ is equivalent to testing “H0: p=p0 against H1: p>p0 “ Thus, H0 is rejected when U is too large. 11/19/2018 SA3202, Lecture 13

5 Example Assume we have the following sample: And consider testing H0: = (the 30th percentile is 45) against H1: < (the 30th percentile is less than 45) The H0 is rejected if U=# {Xi| Xi<=45} is too large. Under H0, U~Binom(20, .3). n=20, p=.3 ============================================================================== Event U<= 0 U<= U<= U<= U<= U<=5 U<=6 U<=7 U<=8 U<=9 U<=10 Prob Event U<=11 U<= U<=13 U<= U<=15 U<=16 U<=17 U<=18 U<=19 U<=20 Prob ============================================================================= 11/19/2018 SA3202, Lecture 13

6 From the Binomial table, we have
P(U<=9)=.952 So for a 5% level test, we reject H0 if U>=10. Since the observed U=10, we reject H0. Remark Theoretically, in the quantile test, we can ignore the possibility that an observation exactly equals a (usually called a “tie”), because for a continuous distribution this event has a zero probability. In practice, however, “ties” do occur, and the usual practice is to discard these observations and to base the test on the remaining observations. 11/19/2018 SA3202, Lecture 13

7 CI for Quantiles Feature Nonparametric CI for the p-th quantile is obtained using order statistics of the sample as confidence limits. Procedure The procedure is to find r and s such that P(X(r )<=xp<X(s)) is equal to the nominal confidence coefficient Let U=#{Xi | Xi<=xp}. Then Pr(X(r )<=xp< X(s) )=Pr( r<=U<s). 11/19/2018 SA3202, Lecture 13

8 Remarks Remark 1 By the continuity of F, the events X(r )=xp and X(s)=xp have zero probabilities. Therefore Pr(X(r )<=xp<=X(s))=Pr(X(r )<=xp<X(s)) =Pr(r<=U<s) Thus, we may use the following CI for xp: X(r )<=xp <= X(s) With a given confidence coefficient. 11/19/2018 SA3202, Lecture 13

9 Remark 2 Since tables of the binomial usually give cumulative probabilities of the form Pr(U<=r) or Pr(U>=r), we use the following formulas: Pr(X(r )<=xp<=X(s))=Pr(X(r )<=xp<X(s)) (by continuity) =Pr(r<=U<s) =Pr(U<=s-1)-Pr(U<=r-1) ={1-Pr(U>s-1)}-{1-Pr(U>r-1)} =Pr(U>=r)-Pr(U>=s) 11/19/2018 SA3202, Lecture 13

10 Example To obtain a CI for the median, on the basis of a sample of size n=10, note that from the tables of the binomial distribution Binom(10,.5), we have Event U= U<=1 U<=2 U<=3 U<=4 U<=5 U<=6 U<=7 U<=8 U<=9 Probability Therefore Pr(X(1)<=x <=X(10))=Pr(1<=U<10)=Pr(U<=9)-Pr(U<=0)= =.9980 Pr(1<=U<9)=Pr(U<=8)-Pr(U<=0)= =.988 Pr(3<=U<8)=Pr(U<=7)-Pr(U<=2)= =.89 It follows that a nominal 99% CI for the median is X(1)<x <X(9) a nominal 90% CI for the median is X(3)<x <X(8). 11/19/2018 SA3202, Lecture 13

11 The Quantile Test for Large Samples
For large n, we can use the normal approximation to the Binomial distribution to find r and s. The key idea here is that U ~AN(np, np(1-p)) . Use a continuity correction, we have Pr(r<=U<s)=Pr(r-.5<=U<=s-.5) Then the approximate CI is r=np+.5-table* (np(1-p))^(1/2) s=np+.5-table*(np(1-p))^(1/2) 11/19/2018 SA3202, Lecture 13

12 Example For n=100, the CI limits for a 95% CI for the median is
Thus, the approximation 95% CI for the median is [X(41), X(60)] 11/19/2018 SA3202, Lecture 13

13 The Sign Test for the Median
Recall that to test H0: =a (the median is a), we may use the statistic U which is “the number of observations which are less or equal to a”. Note that this statistic is simply the number of non-positive terms in the sequence of the following differences X1-a, X2-a, …, Xn-a Let M=# of the positive terms among all nonzero terms Then M~Binom(n’, .5) , where n’ is the number of nonzero differences. The M here is known as a sign statistic. The test based on M is called a sign test. M is usually less than U. They are equal when there are no observations equal to a. 11/19/2018 SA3202, Lecture 13


Download ppt "Lecture 13 The Quantile Test"

Similar presentations


Ads by Google