# Statistical test for P(x|a)>P(x|b)>P(x|c)

I have three within-participant conditions (a, b, and c). I hypothesize that compared to condition a, some event x is less likely under condition b and is even less likely under c.

Namely P(x|a)>P(x|b)>P(x|c).

1. Using ANOVA I can check that the probability in the three conditions is different, but I have a stronger hypothesis.
2. I can have two independent t-tests (for the hypotheses P(x|a)>P(x|b) AND P(x|b)>P(x|c)), but I'm not sure how to integrate their results.
3. Using some model, such as linear regression, I can test a specific functional change in probability (e.g. linear) across the three conditions, but it's a stronger hypothesis than what I currently have.

What is an appropriate statistical test for my hypothesis?

Example: I hypothesize that greater alcohol consumption is associated with a reduced likelihood of shooting a basketball into a hoop. I calculate for each participant the ratio of successful throws when they consume: 0, 5, or 10 units of alcohol. Averaging these ratios across participants, I find that P(success|0)>P(success|5)>P(success|10), but I am searching for some statistical estimate of the significance of this finding.

Don't know the details of your experiment, but based on the description Jonckheere–Terpstra trend test might be what you are looking for.

I hypothesize that greater alcohol consumption is associated with a reduced likelihood of shooting a basketball into a hoop.

If you are only looking to conduct hypothesis testing, then it would be appropriate to use a one-tailed t-test in this scenario. The reason for this is that you are not merely looking to investigate whether the performance of basketball players are different from those who consume more alcohol, but that players who consume more alcohol will score less than those players who have not consumed alcohol.

In this regard, the null and alternative hypothesis can be defined as follows:

Null hypothesis: The mean score of a player that has not consumed alcohol is the same is that of a player which has consumed alcohol.

Alternative hypothesis: The mean score of a player that has not consumed alcohol is greater than that of a player which has consumed alcohol.

To do a hypothetical analysis using R, let us assume that we are comparing performance for Player A (has not consumed alcohol) and Player B (has consumed alcohol).

Player A has a mean score of 70% while Player B has a mean score of 30% over 1000 trials.

a<-rnorm(n=1000, mean=0.7, sd=1)
b<-rnorm(n=1000, mean=0.3, sd=1)


Running a one-tailed t-test on these two samples and specifying the alternative as greater produces the following results:

> t.test(a, b, alternative="greater")

Welch Two Sample t-test

data:  a and b
t = 10.257, df = 1997.8, p-value < 2.2e-16
alternative hypothesis: true difference in means is greater than 0
95 percent confidence interval:
0.3847628       Inf
sample estimates:
mean of x mean of y
0.7460357 0.2877456


Under the above test, we can see that we have a p-value of virtually 0 and thus reject the null hypothesis in favour of the alternative, i.e. that the true difference in means is greater than 0.

By simply running a two-tailed test, this would only tell us that true difference in means is not equal to 0:

> t.test(a, b, alternative="two.sided")

Welch Two Sample t-test

data:  a and b
t = 10.257, df = 1997.8, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.3706644 0.5459159
sample estimates:
mean of x mean of y
0.7460357 0.2877456


As such, if one is looking for the alternative hypothesis to specify a direction (in this case, that performance of basketball players who have not consumed alcohol is better than those who have), then we are looking to use a one-tailed test.

You might also find the following resources of use:

I would suggest a mixed effects logistic regression, with difference codings for the categorical variable (the a/b/c conditions). Your data though should specify the individual events, coded as 1's and 0's, rather than proportions. E.g., from your example, 1 would be a hit and 0 would be a miss.

If you use R, then the model should look something like this (let's say your data is a df with 'throw' as a binomial variable and 'alcohol' as a 3-level categorical variable):

library(lme4)
library(codingMatrices)
contrasts(df\$alcohol) <- contr.diff(3)
model <- glmer(data=df, throw ~ alcohol + (alcohol|Subject), family='binomial', RENL=F)