# Re: [R] t-stat Curve

From: Charles Annis, P.E. <Charles.Annis_at_statisticalengineering.com>
Date: Wed 27 Sep 2006 - 16:34:49 GMT

Isaac:

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-mu,
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)==0.85,
P(abs(phantom(i)*Z*phantom(i))>1.96,H)==0.05), bty="n")
```
text(0, .2, quote(H:~~mu==mu))
text(3, .2, quote(H:~~mu==mu+delta))
```#########################################

```

Charles Annis, P.E.

Charles.Annis@StatisticalEngineering.com phone: 561-352-9699
eFax: 614-455-3265
http://www.StatisticalEngineering.com

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Isaac Barjis Sent: Wednesday, September 27, 2006 11:08 AM To: R-help@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.710882
> qt(0.05, 24)
 -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

R-help@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. Received on Thu Sep 28 02:50:20 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 27 Sep 2006 - 17:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.