For small sample data or rare events data, exact non-parametric tests perform better than asymptotic tests. But they come with the disadvantage of conservativeness. Many corrections have been suggested to reduce this conservativeness but none of them solve the problems entirely. StatXact provides various methods of computing exact p-values. Depending upon the problem at hand, the user can decide which one to use. Let’s consider a hypothetical example of stratified count data. The example shows two sample data with two strata. Events in Treatment1 are rare as compared to the ones in Treatment0. But the event rates are comparable.
For such data of rare events, asymptotic results may not be reliable. But finding the Exact non-parametric distribution is not an easy task.
Let’s see how to compute exact non-parametric distribution…
Exact non-parametric distribution is a discrete distribution. Keeping total events in each stratum fixed, enumerate all possible combinations of events in treatment 0 and treatment1. If Treatment1 is a treatment of interest then consider the number of events in Treatment1 as a test statistic for each stratum. One can decide any other value as test statistic which will uniquely represent the combination in the above said enumeration. Once we have distribution of test statistic for each stratum we will convolute to get the overall distribution. For each test statistic compute the point probability. The point probability is the probability of getting exactly the observed test statistic, i.e. p (Test statistic= ‘Observed Test statistic’). In our example we need to go through all possible counts of Treatment0 and Treatment1, in stratum 1 that sums up to 10 and compute the ratio of rates for each of these pairs of values; do the same for all possible counts of Treatment0,Treatment1, in stratum 2 that sums up to 11.
Exact Distribution for this example is shown below:
Here Test Statistic is total number of events observed in Treatment1.
The next task is to compute p-value from this distribution.
Depending upon the definition of rejection region, p-value computation differs. Let ‘t’ represent the observed value of test statistic. In this example t is 1.
1-Sided p-value is computed as: min (p (T>= t), p (T<= t))
In this example, observed value of test statistic is 1. Its 1-sided p-value is p (T<= 1) = 0.371366.
Graphically it can be represented as:
‘RED’color represents the rejection region from which p-value is computed.
To reduce the conservativeness, Mid-p corrected p-value is used which can be easily obtained by
(1-sided p-value) – (point probability of t)/2
In this example it is 0.241896.
Graphically it can be represented as:
Here half of the point probability of t (Test statistic =1) is in rejection region (RED) and half of it is outside rejection region (BLUE).
2-sided p-value can be computed in many ways:
Using 1-sided p-value i.e. 2*(1-sided p-value). In this example it is 0.742732
Method similar to Asymptotic: Rejection region includes points which are away from mean as compared to observed value. Here mean value of test statistic is 2.076 and observed value is 1. Hence 2 –sided p-value is 0.5187214 as shown below:
Consider those test statistic values that are less likely observed as compared to t. Rejection region includes points which have point probability less than that of the observed value. Point probability of t is 0.258941 shown by a black horizontal line in the plot. Hence 2-sided p-value is: 0.715998
Blaker’s p-value - Blaker (2000) defines the p-value as the sum of the tail probability in the observed tail plus the largest tail probability in the opposite tail that is not greater than the observed tail probability. In this case it is same as earlier 0.715998.
So it seems straight forward to compute these exact p-values. The problem starts when data is large but sparse. In such cases, enumerating all possible combinations becomes difficult.
At this point specialist software like StatXact comes into its own. StatXact computes the exact distribution implicitly and gives the exact p-value and confidence interval to the user in a reasonable time.
We considered the subset of data from the US national Medicare inpatient hospital database (Medpar) for the 1991 Medicare files for the state of Arizona. The study investigates specific cardiovascular conditions for patients and the data set consists of 1495 observations.
If all the combinations/tables are to be enumerated the number goes beyond 14000.
StatXact created the exact distribution of 14733 distribution points and the hypothesis testing results in only 1.5 seconds on a 64 bit Win 7 machine.
To request a trial of StatXact click the button below.
About the Author
Ashwini Joshi is a subject matter expert in mathematics at Cytel. She received an MSc from IIT Bombay and has been an Assistant Professor in Mathematics at the PVG College of Engineering and Technology.