Re: [R] t-stat Curve

From: Richard M. Heiberger <rmh_at_temple.edu>
Date: Wed 27 Sep 2006 - 20:49:09 GMT


## There is some ambiguity in your example.
## You stated a one-sided hypothesis and calculated qt() values for both sides.
## I show both the one-sided and two-sided displays.

library(HH)
## HH_1.5 is available from CRAN for R-2.3.1
##
## HH_1.5 ignores the df.t argument and interprets the request as a
## normal distribution.

## HH_1.8 has been accepted for CRAN for R-2.4.0 and will be in the
## standard places on CRAN when R-2.4.0 is released.
##
## HH_1.8 uses the df.t argument and interprets the request as a
## t-distribution.

old.par <- par(oma=c(4,0,2,5), mar=c(7,7,4,2)+.1)

crit.val.t <- qt(c(.05,.95), 24)
crit.val <- crit.val.t*(12/sqrt(25)) + 80

observed.t <- -1.25
observed.ybar <- 77

norm.setup(mean=80, n=25, sd=12, df.t=24, xlim=c(70,90),
           main="two-sided alpha=.10")
norm.curve(mean=80, n=25, sd=12, df.t=24, crit=crit.val)
abline(v=observed.ybar)
axis(side=3, at=observed.ybar, line=-.5)
norm.setup(mean=80, n=25, sd=12, df.t=24, xlim=c(70,90),
           main="one-sided alpha=.05")
norm.curve(mean=80, n=25, sd=12, df.t=24, crit=crit.val[1], shade="left")
abline(v=observed.ybar)
axis(side=3, at=observed.ybar, line=-.5)

par(old.par)



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 06:56:21 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 - 21:30:06 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.