Re: [R] How to find statistics like that.

From: Ruben Roa <>
Date: Thu 10 Nov 2005 - 23:24:17 EST

> -----Original Message-----
> From: [] On Behalf Of Adaikalavan Ramasamy
> Sent: Thursday, November 10, 2005 10:31 AM
> To: Duncan Murdoch
> Cc:
> Subject: Re: [R] How to find statistics like that.
> If my usage is wrong please correct me. Thank you.
> Here are my reason :
> 1. p-value is a (cumulative) probability and always ranges from 0 to 1.
> A test statistic depending on its definition can wider range of possible
> values.
> 2. A test statistics is one that is calculated from the data without the
> need of assuming a null distribution. Whereas to calculate p-values, you
> need to assume a null distribution or estimate it empirically using
> permutation techniques.
> 3. The directionality of a test statistics may be ignored. For example a
> t-statistics of -5 and 5 are equally interesting in a two-sided testing.
> But the smaller the p-value, more evidence against the null hypothesis.
> Regards, Adai

A statistic is any real-valued or vector-valued function whose domain includes the sample space of a random sample. The p-value is a real-valued function and its domain includes the sample space of a random sample. The p-value has a sampling distribution. The code below, found with Google ("sampling distribution of the p-value" "R command") shows the sampling distribution of the p-value for a t-test of a mean when the null hypothesis is true.

draws<-matrix(rnorm(n.draw * n, mu, sqrt(pop.var)), n) get.p.value<-function(x) t.test(x, mu = mu)$p.value pvalues<-apply(draws, 2, get.p.value)
sum(pvalues <= alpha)
[1] 6 mailing list PLEASE do read the posting guide! Received on Fri Nov 11 00:35:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:07 EST