[R] t-distribution

Nair, Murlidharan T mnair at iusb.edu
Thu Aug 2 19:20:50 CEST 2007


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)



More information about the R-help mailing list