Why does change in the alternative hypothesis (with null-hypothesis being the same) influence the p-value?

816 Views Asked by At

I have two groups of patients, for each of them two health parameters have been measured. Some of these patients died, some are still alive.

I want to see whether there is any relation of between the 2 parameters on mortality.

So I do t-test (separately on each parameter because I do not know how to combine them) but I am confused on how to interpret the results.

This is code in R:

t.test(alive_patients_paramA,dead_patients_paramA,alternative="less")
t.test(alive_patients_paramB,dead_patients_paramB,alternative="less")
  • t.test is called with such defalut parameters: mu = 0, paired = FALSE, var.equal = FALSE, conf.level = 0.95
  • alive_patients_paramA, dead_patients_paramA - two samples of data

Two calls have the following interpretation (if I am not making a mistake):

  • null hypothesis says "mean(alive_patients_paramA) == mean(dead_patients_paramA)"
  • alternative says "mean(alive_patients_paramA) < mean(dead_patients_paramA)"

So I am getting the following results:

> t.test(alive_patients_paramA,dead_patients_paramA,alternative="less")

    Welch Two Sample t-test

data:  alive_patients_paramA and dead_patients_paramA
t = -1.596, df = 121.59, p-value = 0.05654
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
      -Inf 0.1211798
sample estimates:
mean of x mean of y 
 20.54199  23.68740 

As far as I understand, p-value here is not significant, which means that I should reject null-hypothesis. Is it logic correct?

When I call the same function with alternative hypothesis set to 'greater', I get kind of "complimentary" p-value. Why? and how should I interpret the 'new' p-value of 0.9435? In such a case, I would accept the null hypothesis?

> t.test(alive_patients_paramA,dead_patients_paramA,alternative="greater")

    Welch Two Sample t-test

data:  alive_patients_paramA and dead_patients_paramA
t = -1.596, df = 121.59, p-value = 0.9435
alternative hypothesis: true difference in means is greater than 0
95 percent confidence interval:
 -6.412007       Inf
sample estimates:
mean of x mean of y 
 20.54199  23.68740 

What value of p and alternative hypothesis should I believe and why?

UPD: from the R-site, if this is of any relevance: "The t.test( ) function produces a variety of t-tests. Unlike most statistical packages, the default assumes unequal variance and applies the Welsh df modification." I think by how I call the function, I do use default parameters except for specifying the alternative hypothesis.

1

There are 1 best solutions below

3
On

You're doing a one-sided test, so you're not testing "is mean one different from mean two" you're testing "is mean one less than mean two" and separately "is mean one greater than mean two". If the probablitiy that something is positive is $p$ then the probability that it's negative is $1-p$ (these are continuous so $<$ and $\leq$ are the same).

If the observed average in group one is $10$ and the observed average in group two is $20$ then the probability that the true mean in group one is less than the true mean in group two is going to be much higher than the opposite. That's why one is small and the other is large.

So you should believe both $p$-values, since they relate to two different things. But really you should be running a two-sided test and not a one-sided, so the alternative should be "different" as opposed to "greater" or "less".

Does this answer your question?