2

We measured time of reaction of 8 drivers right before and 15 minutes after drinking certain amount of alcohol. Times of reaction before were:

0.22, 0.18, 0.16, 0.19, 0.20, 0.23, 0.17, 0.25

and after:

0.28, 0.25, 0.20, 0.30, 0.19, 0.26, 0.28, 0.24.

The problem is to test the hypothesis whether drinking alcohol prolongs time of reaction (with a significance level $\alpha=0.05$).

My attempt to the problem:

The classical approach to the problem like that would be to use Kolmogorov–Smirnov test to verify if the distribution of the random variable "times before" (X) is equal to distribution of the random variable "times after" (Y). The value of D=0.625 and p-value=0.08787. It would mean that with significance level $\alpha=0.05$ we operate only on one distribution. However the alternative hypothesis in such case would be in a from $F \neq G$ and it does denote hypothesis "drinking alcohol prolongs time of reaction".

So my second step was to define alternative hypothesis as "CDF of Y lies below CDF of X". I found somewhere that in such situation I should focus only on $D^{-}$. Therefore $D^{-}=0$ and $p=1$. Is that a right solution?

XiaoKa
  • 121
  • That doesn't seem right. Considering p-value ~ 1. That pretty much never happens. In addition the Wilcoxon Signed Rank test could be another good approach. It is quite similar to the Kolomogorov-Smirnoff – Brandon Dec 18 '16 at 20:34
  • In addition your alternative would be something like before < after. It's one tailed. It doesn't say "not equal to" (two tailed) – Brandon Dec 18 '16 at 20:45
  • @ Brandon. Good intuition! Statistician's Folklore: "If the P-value is very small (near 0), doubt the null hypothesis; if the P-value is large (near 1), doubt the model." Here I think the model for the K-S test is an incorrect two-sample model, while the data was collected according to a paired model. – BruceET Dec 19 '16 at 03:40

1 Answers1

0

From your description of the experiment, it seems to me that this is a paired design. Specifically, I suppose that .22 and .28 are for the same driver before and after drinking alcohol.

In that case, there are two difficulties using the K-S test with which I am familiar. First, that test is for two independent samples from two different populations. Second, that test is for continuous data, so that the distribution theory does not allow for ties in the data (which you have). Here is a boxplot of the differences in reaction time for the eight subjects, with exact values superimposed (notice the ties at both extremes). Six of the eight subjects were slower to react after drinking alcohol, some markedly so.

enter image description here

So if your assignment is specifically for drill in the use of K-S tests, then I cannot be of assistance.

If, however, you want to do a test of the paired data to see whether they show a statistically significan increase in reaction time after consuming alcohol, then here are several possibilities.

First, lacking evidence that the data are far from normal, a paired t test is appropriate. Results from R statistical software are as follows (significance at the 1% level).

Bef = c(0.22, 0.18, 0.16, 0.19, 0.20, 0.23, 0.17, 0.25)
Aft = c(0.28, 0.25, 0.20, 0.30, 0.19, 0.26, 0.28, 0.24)

t.test(Bef, Aft, pair=T, alte="less")

        Paired t-test

data:  Bef and Aft 
t = -3.0151, df = 7, p-value = 0.00976
alternative hypothesis: true difference in means is less than 0 
95 percent confidence interval:
        -Inf -0.01858197 
sample estimates:
mean of the differences 
                  -0.05 

A Wilcoxon signed-rank test does not assume normal data, also has difficulty with ties, and tests for differences in medians, but gives a similar result (significance at the 5% level):

wilcox.test(Bef, Aft, pair=T, alte="less")

        Wilcoxon signed rank test with continuity correction

data:  Bef and Aft 
V = 3, p-value = 0.02103
alternative hypothesis: true location shift is less than 0 

Warning message:
In wilcox.test.default(Bef, Aft, pair = T, alte = "less") :
  cannot compute exact p-value with ties

A (one-sided) permutation test does not assume normality and is not so sensitive to ties. The P-value is about 0.011, and so finds a significant difference at the 2% level, but not quite at the 1% level. If you are interested in details of the permutation test, please leave a Comment and I will plan to supply them within a day.

BruceET
  • 51,500
  • Thank you, your comment was very useful. I did not hear about these tests before and indeed, it looks like we need to apply paired test. Here I found a nice instruction and example of the paired t test for anyone interested [link] http://www.statstutor.ac.uk/resources/uploaded/paired-t-test.pdf – XiaoKa Dec 19 '16 at 11:52
  • Glad its cleared up. The paired t test is covered in most elementary statistics texts. If you have everything you need from this post now, please click the check mark to Accept the answer, so it can be dropped from our queue of questions needing attention. Otherwise, please leave a comment here or beneath your question saying what else you need. – BruceET Dec 19 '16 at 18:11