If I have a calculated t can I get the probability associated with it using an R function by giving it the df and t? I know I can do the whole calculation using t.test() or get the t-distribution using qt(). If t=1.11 and df =9 can I get the probability? Thanks../Murli [[alternative HTML version deleted]]
if you mean the area to the left of the 1.11 point on the x axis of a t dist with 9 degrees of freedom, Then you need to use pt(1.11,9). See ?pt for more info. -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Nair, Murlidharan T Sent: Wednesday, August 01, 2007 2:43 PM To: r-help at stat.math.ethz.ch Subject: [R] t-distribution If I have a calculated t can I get the probability associated with it using an R function by giving it the df and t? I know I can do the whole calculation using t.test() or get the t-distribution using qt(). If t=1.11 and df =9 can I get the probability? Thanks../Murli [[alternative HTML version deleted]] ______________________________________________ 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. -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
?pt is what you want. Hope this is helpful, Dan Daniel Nordlund Bothell, WA> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] > On Behalf Of Nair, Murlidharan T > Sent: Wednesday, August 01, 2007 11:43 AM > To: r-help at stat.math.ethz.ch > Subject: [R] t-distribution > > If I have a calculated t can I get the probability associated with it > using an R function by giving it the df and t? I know I can do the whole > calculation using t.test() or get the t-distribution using qt(). If > t=1.11 and df =9 can I get the probability? > > > > Thanks../Murli > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
for the upper tail:> 1-pt(1.11, 9)[1] 0.1478873 -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Nair, Murlidharan T Sent: Thursday, 2 August 2007 4:43 AM To: r-help at stat.math.ethz.ch Subject: [R] t-distribution If I have a calculated t can I get the probability associated with it using an R function by giving it the df and t? I know I can do the whole calculation using t.test() or get the t-distribution using qt(). If t=1.11 and df =9 can I get the probability? Thanks../Murli [[alternative HTML version deleted]] ______________________________________________ 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.
I believe you are looking for the functionality I have in the norm.curve function in the HH package. Download and install HH from CRAN and then look at example(norm.curve)
I tried doing it this way. left<--2.3 right<-2.3 p <- seq(0.001,0.999,,1000) x <- qt(p,df=9) y <- dt(x,df=9) plot(x,y,type="l") x.tmp<-x y.tmp<-y a<-which(x<=left) polygon(x=c(x.tmp[a],rev(x.tmp[a])),y=c(y.tmp[a],rep(0,length(y.tmp[a]))),col="gray90") b<-which(x>=right) polygon(x=c(x.tmp[b],rev(x.tmp[b])),y=c(y.tmp[b],rep(0,length(y.tmp[b]))),col="gray90") Please let me know if I have made any mistakes. Thanks ../Murli -----Original Message----- From: Richard M. Heiberger [mailto:rmh at temple.edu] Sent: Thu 8/2/2007 10:25 AM To: Nair, Murlidharan T; Stephen Tucker; r-help at stat.math.ethz.ch Subject: Re: [R] t-distribution I believe you are looking for the functionality I have in the norm.curve function in the HH package. Download and install HH from CRAN and then look at example(norm.curve)