# [R] {10,20,30}>={25,30,15}

Greg Snow Greg.Snow at intermountainmail.org
Mon May 21 18:39:44 CEST 2007

```To decide on which way to do a one tailed test, you should really ask a
few questions (before looking at the data) either of yourself, your
client, or other expert in the field.

I would start by asking the 3 questions:

1. What will I/you do if A is less than B?
2. What will I/you do if A is equal to B?
3. What will I/you do if A is greater than B?

If the 3 questions all have the same answer, then you really don't need
to do the test.
If the 3 questions have 3 different answers, then you need to do a
two-tailed test.
If the answer to question 2 matches with the answer to either 1 or 3,
then that tells you which combination of hypotheses to use.

For example, if A represents the current drug used to treat a certain
condition and B is a proposed new drug, and larger values are considered
better, then the answer to question 1 is "Switch to B" and the answer to
3 is "Stay with A", but the answer to question 2 depends on outside

If we are happy with drug A, and want to stay with the status quo unless
B is proven better, then the answer to question 2 is "Stay with A" and
we would use H0: A>=B and Ha: A<B.

If we want to switch to B unless it is truly inferior (lower cost, fewer
side effects, etc.) then the answer to 2 is "Switch to B" and we would
use H0: A<=B and Ha: A>B.

This is a general guideline and you should remember that you fail to
reject the null, not accept it.  In these types of cases you should
really decide on what an important difference (practical significance)
is (before looking at the data).  Then construct a confidence interval
and see if the interval includes 0 and/or the important difference
value.  If the interval does not include the important difference value
(and does include values of 0 or in that direction), then you can go
with your question 2 answer above, because even if there is a
difference, it is too small to care about.  If your interval includes
the important difference amount, and not 0, then you can conclude that
there is a difference and respond accordingly.  If your interval
includes both 0 and the important difference (and probably more extreme
values), then you don't have the data to make any conclusions and your
decision should be to collect more (and maybe better) data.

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of
> genomenet at gmail.com
> Sent: Friday, May 18, 2007 12:07 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] {10,20,30}>={25,30,15}
>
> Hi There,
>
> Using t.test to test hypothesis about which one is greater, A or B?
> where A={10,20,30},B={25,30,15}.
>
> My question is which of the following conclusions is right?
>
> #################hypothesis testing 1
>
> h0: A greater than or equal to B
> h1: A less than B
>
> below is splus code
> A=c(10,20,30)
> B=c(25,30,15)
> t.test(c(10,20,30),c(25,30,15),alternative="less")
>
> output:
> p-value=0.3359
>
> because p-value is not less than alpha (0.05), we cannot reject h0.
>
> so A greater than or equal to B.
>
>
> #################hypothesis testing 2
>
> h0: A less than or equal to B
> h1: A greater than B
>
> below is splus code
>
> A=c(10,20,30)
> B=c(25,30,15)
> t.test(c(10,20,30),c(25,30,15),alternative="greater")
>
> output:
> p-value=0.6641
>
> because p-value is not less than alpha (0.05), we cannot reject h0.
>
> so A less than or euqal to B.
> #########################################
>
> Thank you very much.
> Van
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help