I?m trying to do a t-test, where the null hypothesis for the two data sets has to be: ?the means are the same?/?difference in means is equal to one? Using the t.test function in R I?m able to see that it uses the following ?alternative hypothesis?: alternative hypothesis: true difference in means is not equal to 0 but does not seem to specify null hypothesis. I believe alternative and null hypotheses are different, although I don?t exactly know how. So what should I use for my t-test? Or is t.test ok?
You need to include the argument "mu=1" (without parentheses). For example: > t.test(group1,group2, mu=1) for a two-sample independent groups t-test. If you type: > ?t.test you can see the help information for the t.test function. RIck On 09/08/2016 08:06 AM, Matti Viljamaa wrote:> I?m trying to do a t-test, where the null hypothesis for the two data sets has to be: > > ?the means are the same?/?difference in means is equal to one? > > Using the t.test function in R I?m able to see that it uses the following ?alternative hypothesis?: > > alternative hypothesis: true difference in means is not equal to 0 > > but does not seem to specify null hypothesis. I believe alternative and null hypotheses are different, although > I don?t exactly know how. > > So what should I use for my t-test? Or is t.test ok? > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fstat.ethz.ch%2fmailman%2flistinfo%2fr-help&data=01%7c01%7crab45%40pitt.edu%7c99a5b7c1533548c5ead708d3d7e0bb76%7c9ef9f489e0a04eeb87cc3a526112fd0d%7c1&sdata=Pf9Tku8lIeH9quNmY2dEmR4HNSLgShRP7p7Hx9HUCMY%3d > PLEASE do read the posting guide https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.R-project.org%2fposting-guide.html&data=01%7c01%7crab45%40pitt.edu%7c99a5b7c1533548c5ead708d3d7e0bb76%7c9ef9f489e0a04eeb87cc3a526112fd0d%7c1&sdata=eGCmYy70ceyiJ%2bpgDXA8SaHHma%2f4DbxhIbSARUDYwxg%3d > and provide commented, minimal, self-contained, reproducible code.
Dear Matti On 08/09/2016 13:06, Matti Viljamaa wrote:> I?m trying to do a t-test, where the null hypothesis for the two data sets has to be: > > ?the means are the same?/?difference in means is equal to one? >That is two statements not one. Do you mean that your null is that the difference is 1? If so just subtract 1 from all the scores in the group which is predicted to be higher and run the t-test on the resulting scores.> Using the t.test function in R I?m able to see that it uses the following ?alternative hypothesis?: > > alternative hypothesis: true difference in means is not equal to 0It means that the null is that the difference is zero.> > but does not seem to specify null hypothesis. I believe alternative and null hypotheses are different, although > I don?t exactly know how. > > So what should I use for my t-test? Or is t.test ok? > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >-- Michael http://www.dewey.myzen.co.uk/home.html
> On 08 Sep 2016, at 15:48, Michael Dewey <lists at dewey.myzen.co.uk> wrote: > > Dear Matti > > On 08/09/2016 13:06, Matti Viljamaa wrote: >> I?m trying to do a t-test, where the null hypothesis for the two data sets has to be: >> >> ?the means are the same?/?difference in means is equal to one? >> > > That is two statements not one. Do you mean that your null is that the difference is 1? If so just subtract 1 from all the scores in the group which is predicted to be higher and run the t-test on the resulting scores.Sorry typo, should of course be: ?the means are the same?/?difference in means is equal to zero? so they are synonymous.>> Using the t.test function in R I?m able to see that it uses the following ?alternative hypothesis?: >> >> alternative hypothesis: true difference in means is not equal to 0 > > It means that the null is that the difference is zero. > >> >> but does not seem to specify null hypothesis. I believe alternative and null hypotheses are different, although >> I don?t exactly know how. >> >> So what should I use for my t-test? Or is t.test ok? >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. >> > > -- > Michael > http://www.dewey.myzen.co.uk/home.html