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
At the alpha level you set, A is neither greater nor less than B. Supposing you don't use paired t.test: data: c(10, 20, 30) and c(25, 30, 15) t = -0.4588, df = 3.741, p-value = 0.6717 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -24.06675 17.40008 sample estimates: mean of x mean of y 20.00000 23.33333 it tells you what is the null and what is the alternative. genomenet wrote:> > 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 >-- View this message in context: http://www.nabble.com/%7B10%2C20%2C30%7D%3E%3D%7B25%2C30%2C15%7D-tf3779346.html#a10688603 Sent from the R help mailing list archive at Nabble.com.
Van--- Perhaps I'm misunderstanding your question, but in a null hypothesis framework, the only conclusion you can draw from failing to reject the null hypothesis is that, based on your observed data, you were unable to conclude that your null hypothesis was false. Put another way, the correct conclusion for both of your hypothesis tests is "inconclusive." Kyle H. Ambert Graduate Student, Dept. Behavioral Neuroscience Oregon Health & Science University ambertk@ohsu.edu On May 18, 2007, at 11:07 AM, genomenet@gmail.com wrote:> 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@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
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 knowledge/opinions about the 2 drugs. 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 > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >