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

Liviu Andronic landronimirc at gmail.com
Fri Oct 1 08:33:49 CEST 2010


Hello
Thanks all for your input!


On Fri, Oct 1, 2010 at 3:55 AM, RICHARD M. HEIBERGER <rmh at temple.edu> wrote:
> The t-value in the cor.test is already scaled for 30 df by the time it
> is printed.  Giving an n-value scales it again, by dividing the
> standard deviation by sqrt(n).  Since you are already in the standard
> t-scaling, n=1 is the correct value for your example.
> This is the graph you are looking for:
>
>     normal.and.t.dist(obs.mean=5.5651, deg.freedom=30, alpha.right=.025,
>                       Use.alpha.left=TRUE, Use.obs.mean=TRUE, xmin=-6)
>
This is indeed the graph that I was looking for. I was assuming that,
since I knew both df and t, I should specify both, but I was obviously
wrong. Also, I prefer this graph to the below because it's cleaner and
should raise less questions.

Thanks a lot for the helpful functions. Best regards
Liviu


> The above graph does not specifiy n, and therefore shows
> "Standard t Density", and only the t axis.  The green 5.565 is the observed
> t-value, and the -5.565 is the boundary of the p-value region on the other
> side.
> We need both sides because the cor.test said the alternative hypothesis is
> two-sided.
>
> Here is almost the same graph, this time with n=1.  Now it shows "t density"
> with
> standard error of x.bar and the x.bar axis as well as the t axis.
>     normal.and.t.dist(obs.mean=5.5651, deg.freedom=30, alpha.right=.025,
>                       Use.alpha.left=TRUE, Use.obs.mean=TRUE, xmin=-6, n=1)
> In this example with n=1, the x.bar scale and the t scale are identical.
> The blue +/- 2.042 are the boundaries of the rejection region in x.bar
> units.
> On your original graph, simplified here
>
> normal.and.t.dist(obs.mean=5.5651, deg.freedom=30, alpha.right=0.025,
>                   Use.alpha.left=TRUE, Use.obs.mean=TRUE, n=32)
>
> the blue values are in the x.bar scale (as indicated on the graph),
> asssuming that the observed mean x.bar=5.5651 comes from a
> distribution of x.bar with standard deviation 1/sqrt(32).
> Scale that to the t-scale with 5.5651/(1/sqrt(32)) = 31.48096 and that
> is the number you were querying.
>
> Expand the graph to fill the screen and you will see that the right boundary
> of the rejection region is suppressed by R to avoid overprinting.
> If you extend the graph to the left, with xmin=-6,
>
> normal.and.t.dist(obs.mean=5.5651, deg.freedom=30, alpha.right=0.025,
>                   Use.alpha.left=TRUE, Use.obs.mean=TRUE, n=32, xmin=-6)
>
> then you will see that the left boundary of the p-value region -31.481
> is also displayed.
> Rich
>



-- 
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




More information about the R-sig-teaching mailing list