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

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


> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch [SMTP:r-help-bounces@stat.math.ethz.ch] On Behalf Of Adaikalavan Ramasamy
> Sent: Thursday, November 10, 2005 10:31 AM
> To: Duncan Murdoch
> Cc: r-help@stat.math.ethz.ch
> 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
>



Hi:
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.
Ruben

n<-18
mu<-40
pop.var<-100
n.draw<-200
alpha<-0.05
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)
hist(pvalues)
sum(pvalues <= alpha)
[1] 6



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