[R-sig-teaching] plotting hypothesis of correlation t-test

Greg Snow Greg.Snow at imail.org
Fri Oct 1 01:33:22 CEST 2010


It looks like the -0.361 is qt(0.025, 30) * 0.177 where 0.177 is the standard error of the mean.  And 31.481 is approximately (possible rounding error from limited reporting) 5.565/0.177, so those are the numbers on the scale of the original mean, not the t-statistic.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-sig-teaching-bounces at r-project.org [mailto:r-sig-teaching-
> bounces at r-project.org] On Behalf Of Liviu Andronic
> Sent: Thursday, September 30, 2010 4:11 PM
> To: R-sig-teaching
> Cc: Richard M. Heiberger
> Subject: [R-sig-teaching] plotting hypothesis of correlation t-test
> 
> Dear all
> I'm not sure that this is an r-sig-teaching per se, but I need it for
> teaching so here I go.
> 
> I need to plot the hypothesis of a correlation test. The only
> semi-automated way I know to do this is RcmdrPlugin.HH. For example,
> > cor.test(mtcars$am, mtcars$drat, alternative="two.sided",
> method="pearson")
> 
> 	Pearson's product-moment correlation
> 
> data:  mtcars$am and mtcars$drat
> t = 5.5651, df = 30, p-value = 4.727e-06
> alternative hypothesis: true correlation is not equal to 0
> 95 percent confidence interval:
>  0.4843991 0.8501319
> sample estimates:
>       cor
> 0.7127111
> > qt(c(0.025), df=30, lower.tail=F)
> [1] 2.042272
> 
> 
> Then I supply these data to the 'Plot Hypotheses (HH)' in Rcmdr >
> Cont. Distributions > t distro.
> require(RcmdrPlugin.HH)
> normal.and.t.dist.result <- normal.and.t.dist(std.dev=NA, n=32,
>   deg.freedom=30, mu.H0=0, xmin=NA, xmax=NA, gxbar.min=NA,
> gxbar.max=NA,
>   Use.alpha.right=TRUE, alpha.right=0.025, Use.alpha.left=TRUE,
>   alpha.left=0.025, Use.mu.H1=FALSE, mu.H1=NA, Use.obs.mean=TRUE,
>   obs.mean=5.5651, hypoth.or.conf="Hypoth", col.mean="lime green",
>   col.alpha="blue", col.beta="red", col.conf="pale green",
>   col.conf.arrow="dark green", col.mean.label="lime green",
>   col.alpha.label="blue", col.beta.label="red", col.conf.label="dark
> green",
>   cex.crit=1.2)
> 
> 
> There are several elements that I do not quite understand in the
> resulting graph [1]:
> - what does '0.361' correspond to? If this is the mean (x bar), why
> would I be interested in this for this particular hypothesis testing?
> - what does '31.481' correspond to? From the colors I understand that
> it's related to the observed t statistic, but I cannot figure what
> exactly it represents.
> 
> I'd be grateful for any insights. Regards
> Liviu
> 
> [1] http://s000.tinyupload.com/index.php?file_id=02099991814244792735
> 
> 
> 
> --
> Do you know how to read?
> http://www.alienetworks.com/srtest.cfm
> http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
> Do you know how to write?
> http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
> 
> _______________________________________________
> R-sig-teaching at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-teaching




More information about the R-sig-teaching mailing list