# Issue with t.test

8 messages
Open this post in threaded view
|

## Issue with t.test

 I am writing this e-mail as I have come across one issue while performing t-test using R. If the function t.test(�) is used, a p-value of 1 is obtained for a calculated t-value greater than 1.96. If the t-value is greater than 1.96, the null hypothesis is rejected. However, if the p-value is greater than 0.05, one may say that there is not enough evidence to reject the null hypothesis. Thus, a t-value of greater than 1.96 and a p-value of 1 leaves the user of R software confused on whether to reject or not to reject the null. Moreover, how can p-value of stochastic process be exactly equal to 1? Can you please guide me on whom should I report this issue to? Or can you please forward this issue to the appropriate person / team? Thanking you, Sincerely, Smruti Bulsari Assistant Professor Department of Human Resource Development Veer Narmad South Gujarat University Surat - 395 007 (Gujarat) INDIA Ph:+91-261-2256071 (Ext. 204) Alternate E-mail: [hidden email] LinkedIn Profile: https://www.linkedin.com/in/smruti-bulsari-0a30b312/Blog Posts: https://wordpress.com/posts/smrutibulsari.wordpress.com        [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Issue with t.test

 Can you show us an example with the data that you are using and the output from t.test. A t-value of 1.96 is not an automatic rejection.  It depends on alpha and the degrees of freedom.  Even if we set alpha at 0.05, 1.96 should not give a p-value less than 0.05 with finite degrees of freedom. This also depends on the arguments to t.test.  If the alternative is set to "Less" then a t value of 1.96 would give a p-value close to 0.975 for high degrees of freedom. The only time I have seen t.test give a p-value of 1 is when the data mean exactly equals the null hypothesis mean and the alternative is the default of two.sided. For us to diagnose what is going on we need to see your command (how you are calling t.test) and what data you are using. On Tue, Mar 12, 2019 at 1:49 PM SMRUTI BULSARI <[hidden email]> wrote: > > I am writing this e-mail as I have come across one issue while performing t-test using R. If the function t.test(…) is used, a p-value of 1 is obtained for a calculated t-value greater than 1.96. If the t-value is greater than 1.96, the null hypothesis is rejected. However, if the p-value is greater than 0.05, one may say that there is not enough evidence to reject the null hypothesis. Thus, a t-value of greater than 1.96 and a p-value of 1 leaves the user of R software confused on whether to reject or not to reject the null. Moreover, how can p-value of stochastic process be exactly equal to 1? Can you please guide me on whom should I report this issue to? Or can you please forward this issue to the appropriate person / team? > > Thanking you, > > Sincerely, > > Smruti Bulsari > > Assistant Professor > Department of Human Resource Development > Veer Narmad South Gujarat University > Surat - 395 007 > (Gujarat) INDIA > > Ph:+91-261-2256071 (Ext. 204) > > Alternate E-mail: [hidden email] > > LinkedIn Profile: https://www.linkedin.com/in/smruti-bulsari-0a30b312/> > Blog Posts: https://wordpress.com/posts/smrutibulsari.wordpress.com> > > >         [[alternative HTML version deleted]] > > ______________________________________________ > [hidden email] 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. -- Gregory (Greg) L. Snow Ph.D. [hidden email] ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: [FORGED] Re: Issue with t.test

 On 13/03/19 9:06 AM, Greg Snow wrote: > The only time I have seen t.test give a p-value of 1 is when the > data mean exactly equals the null hypothesis mean and the alternative > is the default of two.sided. Doesn't have to be *exact* equality.  Just close! E.g.: set.seed(42) x <- runif(10) mew <- 0.63626 mew==mean(x) # FALSE t.test(x,mu=mew) cheers, Rolf -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Issue with t.test

Open this post in threaded view
|

## Re: Issue with t.test

 Hi Smruti, In the example in question, you are probably doing something like this: # I didn't see any attachment for the data X<-rnorm(99,mean=59.96753) t.test(X,mu=50,alternative="less")        One Sample t-test data:  X t = 101.29, df = 98, p-value = 1 alternative hypothesis: true mean is less than 50 95 percent confidence interval:     -Inf 60.07022 sample estimates: mean of x 59.90779 What this probably means is since the lower confidence interval for the test is undefined, the program returns a p-value of 1 as an estimate, much like the p-value<2.2e-16 for the other tests. > 1-2e-16 [1] 1 Neither of these values are exact, but indicate that the null hypothesis should be accepted or rejected respectively. Jim ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Issue with t.test

 Dear Jim Lemon: First of all, very sorry for such a long delay in replying to your e-mail. I am quite surprised that you did not receive the .csv and .R files attachment with my previous e-mail. I am re-sending those files.  However, by any chance, you do not receive them even this time, I must say that you have simulated the values that are almost similar in the example on which I undertook the one sample t-test using t.test. I have got a clear idea of how the t.test algorithm works and generates values through the communication with the R-team so far. Thank you very much for your detailed and prompt reply. Kindest regards, Smruti Bulsari ________________________________ From: Jim Lemon <[hidden email]> Sent: 14 March 2019 02:25 To: SMRUTI BULSARI; r-help mailing list Subject: Re: [R] Issue with t.test Hi Smruti, In the example in question, you are probably doing something like this: # I didn't see any attachment for the data X<-rnorm(99,mean=59.96753) t.test(X,mu=50,alternative="less")        One Sample t-test data:  X t = 101.29, df = 98, p-value = 1 alternative hypothesis: true mean is less than 50 95 percent confidence interval:     -Inf 60.07022 sample estimates: mean of x 59.90779 What this probably means is since the lower confidence interval for the test is undefined, the program returns a p-value of 1 as an estimate, much like the p-value<2.2e-16 for the other tests. > 1-2e-16 [1] 1 Neither of these values are exact, but indicate that the null hypothesis should be accepted or rejected respectively. Jim ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.