> Sorry, I realized that is is fairly easy to test that it is an issue > with which tail of the distribution you use. This should show what is > going on better than my prior message. > > 1.353946/2 = 0.676973 > 1 - 0.676973 = 0.323027 > 0.323027 * 2 = 0.646054 > > in pt(), the default is lower.tail=TRUE. Switching it to FALSE just > looks at the other tail of the distribution. It was difficult to see > because of the multiplication by 2. > > Should I choose lower.tail value based on the sign of the t-stat?
I note that when I use 2*pt(Tstat, Df, lower.tail=FALSE) I get inconsistent results when Tstat<0. If I say: lt <- TRUE if(Tstat > 0) lt <- FALSE pt(Tstat, Df, lower.tail=lt) I get consistent results. I am happy with the results but I would like to know why? ?pt gives no hints for why this happens. cheers Worik > Josh > > > >> t.1$p.value > > [1] 0.646054 > > > > I would have thought these would have been the same. Like below.... > > > >> t.2 <- t.test(x2, y2) > >> 2 * pt(t.2$statistic, t.2$parameter) > > t > > 0.8679732 > >> t.2$p.value > > [1] 0.8679732 > > > > This is what I expect. > > > > clearly I misunderstand some thing. What is it? > > > > cheers > > Worik > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help@r-project.org 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. > > > > > > -- > Joshua Wiley > Ph.D. Student > Health Psychology > University of California, Los Angeles > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.