[R] t-stat Curve
Charles Annis, P.E.
Charles.Annis at StatisticalEngineering.com
Wed Sep 27 18:34:49 CEST 2006
Isaac:
You will likely find something helpful here:
http://addictedtor.free.fr/graphiques/thumbs.php
I also recently came across this code (I thought it was at the URL above,
but I can't find it now) that may be useful with modification.
I apologize to the code-writer for having lost the correct reference. (If
anyone finds it, please send the reference to me. Thanks.)
#########################################
# neighboring (not "overlapping") normal densities
dev.off()
x<-seq(-10,10,length=400)
y1<-dnorm(x)
y2<-dnorm(x,m=3)
par(mar=c(5,4,2,1))
plot(x, y2, xlim=c(-3,8), type="n", xlab=quote(Z==frac(mu[1]-mu[2],
sigma/sqrt(n))), ylab="Density")
polygon(c(1.96,1.96,x[240:400],10), c(0,dnorm(1.96,m=3),y2[240:400],0),
col="grey80", lty=0)
lines(x, y2)
lines(x, y1)
polygon(c(-1.96,-1.96,x[161:1],-10), c(0,dnorm(-1.96,m=0), y1[161:1],0),
col="grey30", lty=0)
polygon(c(1.96, 1.96, x[240:400], 10), c(0,dnorm(1.96,m=0),
y1[240:400],0), col="grey30")
legend(4.2, .4, fill=c("grey80","grey30"),
legend=expression(P(abs(phantom(i)*Z*phantom(i))>1.96,
H[1])==0.85,
P(abs(phantom(i)*Z*phantom(i))>1.96,H[0])==0.05), bty="n")
text(0, .2, quote(H[0]:~~mu[1]==mu[2]))
text(3, .2, quote(H[1]:~~mu[1]==mu[2]+delta))
#########################################
Charles Annis, P.E.
Charles.Annis at StatisticalEngineering.com
phone: 561-352-9699
eFax: 614-455-3265
http://www.StatisticalEngineering.com
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Isaac Barjis
Sent: Wednesday, September 27, 2006 11:08 AM
To: R-help at stat.math.ethz.ch
Subject: [R] t-stat Curve
Number of subjects = 25
Mean of Sample = 77
Standard Deviation (s) = 12
sem = 2.4
df = 24
The claim is that population mean is less than 80
* > 80
So our H0 (null hupotheis) is * > 80
> qt(.95,24)
[1] 1.710882
> qt(0.05, 24)
[1] -1.710882
tstat = -1.25 on t24 falls between 1.711 (.95,24) and *1.711 (.005,24)
How Could I sketch t curve for the above data where my * would be at the
center?
Best Regards
Isaac
Dr. I. Barjis
Assistant Professor
Summer and Evening Coordinator
Department of Biological Sciences
Room P313
300 Jay Street
Brooklyn, NY 11201
Phone: (718)2605285
Fax: (718)2548680
Fax: (718) 254-8595 Department Office
http://websupport1.citytech.cuny.edu/Faculty/ibarjis
More information about the R-help
mailing list