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

2005-11-11 Thread John Wilkinson \(pipex\)
Adai,

I recently came across the following definition of a statistic
which may be relevent to the discussion.

John
-

Beran’s (2003) provocative definition of statistics as “the study of
algorithms for data analysis” elevates computational considerations to the
forefront of the field. It is apparent that the evolutionary success of
statistical methods is to a significant degree determined by considerations
of computational convenience. As a result,design and dissemination of
statistical software has become an integral part of statistical research.

from this it follows that a 'Statistic' is

  A mathematical function or  algorithm for data analysis



Duncan Murdoch wrote


On 11/9/2005 10:01 PM, Adaikalavan Ramasamy wrote:
 I think an alternative is to use a p-value from F distribution. Even
 tough it is not a statistics, it is much easier to explain and popular
 than 1/F. Better yet to report the confidence intervals.

Just curious about your usage:  why do you say a p-value is not a statistic?

Duncan Murdoch

Adaikalavan Ramasamy replied
-

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

__
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


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

2005-11-10 Thread Duncan Murdoch
On 11/9/2005 10:01 PM, Adaikalavan Ramasamy wrote:
 I think an alternative is to use a p-value from F distribution. Even
 tough it is not a statistics, it is much easier to explain and popular
 than 1/F. Better yet to report the confidence intervals.

Just curious about your usage:  why do you say a p-value is not a statistic?

Duncan Murdoch

 
 Regards, Adai
 
 
 
 On Wed, 2005-11-09 at 17:09 -0600, Mike Miller wrote:
 
On Wed, 9 Nov 2005, Gao Fay wrote:


Hi there,

Suppose mu is constant, and error is normally distributed with mean 0 and 
fixed variance s. I need to find a statistics that:
Y_i = mu + beta1* I1_i beta2*I2_i + beta3*I1_i*I2_i + +error, where I_i is 1 
Y_i is from group A, and 0 if Y_i is from group B.

It is large when  beta1=beta2=0
It is small when beta1 and/or beta2 is not equal to 0

How can I find it by R? Thank you very much for your time.


That's a funny question.  Usually we want a statistic that is small when 
beta1=beta2=0 and large otherwise.

Why not compute the usual F statistic for the null beta1=beta2=0 and then 
use 1/F as your statistic?

Mike

__
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

 
 
 __
 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

__
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


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

2005-11-10 Thread Adaikalavan Ramasamy
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



On Thu, 2005-11-10 at 06:05 -0500, Duncan Murdoch wrote:
 On 11/9/2005 10:01 PM, Adaikalavan Ramasamy wrote:
  I think an alternative is to use a p-value from F distribution. Even
  tough it is not a statistics, it is much easier to explain and popular
  than 1/F. Better yet to report the confidence intervals.
 
 Just curious about your usage:  why do you say a p-value is not a statistic?
 
 Duncan Murdoch
 
  
  Regards, Adai
  
  
  
  On Wed, 2005-11-09 at 17:09 -0600, Mike Miller wrote:
  
 On Wed, 9 Nov 2005, Gao Fay wrote:
 
 
 Hi there,
 
 Suppose mu is constant, and error is normally distributed with mean 0 and 
 fixed variance s. I need to find a statistics that:
 Y_i = mu + beta1* I1_i beta2*I2_i + beta3*I1_i*I2_i + +error, where I_i is 
 1 
 Y_i is from group A, and 0 if Y_i is from group B.
 
 It is large when  beta1=beta2=0
 It is small when beta1 and/or beta2 is not equal to 0
 
 How can I find it by R? Thank you very much for your time.
 
 
 That's a funny question.  Usually we want a statistic that is small when 
 beta1=beta2=0 and large otherwise.
 
 Why not compute the usual F statistic for the null beta1=beta2=0 and then 
 use 1/F as your statistic?
 
 Mike
 
 __
 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
 
  
  
  __
  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
 


__
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


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

2005-11-10 Thread Liaw, Andy
The definition of a statistic that I learned in grad school is that it's a
function of a random sample from a population.  Any p-value would fit that
definition.

Andy

 From: Adaikalavan Ramasamy
 
 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
 
 
 
 On Thu, 2005-11-10 at 06:05 -0500, Duncan Murdoch wrote:
  On 11/9/2005 10:01 PM, Adaikalavan Ramasamy wrote:
   I think an alternative is to use a p-value from F 
 distribution. Even
   tough it is not a statistics, it is much easier to 
 explain and popular
   than 1/F. Better yet to report the confidence intervals.
  
  Just curious about your usage:  why do you say a p-value is 
 not a statistic?
  
  Duncan Murdoch
  
   
   Regards, Adai
   
   
   
   On Wed, 2005-11-09 at 17:09 -0600, Mike Miller wrote:
   
  On Wed, 9 Nov 2005, Gao Fay wrote:
  
  
  Hi there,
  
  Suppose mu is constant, and error is normally 
 distributed with mean 0 and 
  fixed variance s. I need to find a statistics that:
  Y_i = mu + beta1* I1_i beta2*I2_i + beta3*I1_i*I2_i + 
 +error, where I_i is 1 
  Y_i is from group A, and 0 if Y_i is from group B.
  
  It is large when  beta1=beta2=0
  It is small when beta1 and/or beta2 is not equal to 0
  
  How can I find it by R? Thank you very much for your time.
  
  
  That's a funny question.  Usually we want a statistic 
 that is small when 
  beta1=beta2=0 and large otherwise.
  
  Why not compute the usual F statistic for the null 
 beta1=beta2=0 and then 
  use 1/F as your statistic?
  
  Mike
  
  __
  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
  
   
   
  
  __
   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
  
 
 
 
 __
 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
 


__
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


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

2005-11-10 Thread Ruben Roa
 -Original Message-
 From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] 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


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

2005-11-10 Thread Duncan Murdoch
On 11/10/2005 7:31 AM, Adaikalavan Ramasamy wrote:
 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

Thanks for your explanation.  I think your interpretation is one that is 
sometimes taught, but I think it's more useful to think of a p-value as 
just another statistic, whose null distribution (in the ideal case, but 
not always in practice) is a uniform distribution on (0,1), and whose 
distribution when the alternative is true (again, ideally) tends to be 
more concentrated near 0.  This takes a lot of the mysticism out of them.

Duncan Murdoch
 
 
 On Thu, 2005-11-10 at 06:05 -0500, Duncan Murdoch wrote:
 
On 11/9/2005 10:01 PM, Adaikalavan Ramasamy wrote:

I think an alternative is to use a p-value from F distribution. Even
tough it is not a statistics, it is much easier to explain and popular
than 1/F. Better yet to report the confidence intervals.

Just curious about your usage:  why do you say a p-value is not a statistic?

Duncan Murdoch


Regards, Adai



On Wed, 2005-11-09 at 17:09 -0600, Mike Miller wrote:


On Wed, 9 Nov 2005, Gao Fay wrote:



Hi there,

Suppose mu is constant, and error is normally distributed with mean 0 and 
fixed variance s. I need to find a statistics that:
Y_i = mu + beta1* I1_i beta2*I2_i + beta3*I1_i*I2_i + +error, where I_i is 
1 
Y_i is from group A, and 0 if Y_i is from group B.

It is large when  beta1=beta2=0
It is small when beta1 and/or beta2 is not equal to 0

How can I find it by R? Thank you very much for your time.


That's a funny question.  Usually we want a statistic that is small when 
beta1=beta2=0 and large otherwise.

Why not compute the usual F statistic for the null beta1=beta2=0 and then 
use 1/F as your statistic?

Mike

__
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



__
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



__
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


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

2005-11-10 Thread Mike Miller
On Thu, 10 Nov 2005, Ruben Roa wrote:

 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


The sampling distribution of a p-value when the null hypothesis is true 
can be given more simply by this R code:

runif()

That holds for any valid test, not just a t test, that produces p-values 
distributed continuously on [0,1].  Discrete distributions can't quite do 
that without special tweaking.

Mike

__
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


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

2005-11-10 Thread Ruben Roa
 -Original Message-
 From: Mike Miller [SMTP:[EMAIL PROTECTED]
 Sent: Thursday, November 10, 2005 12:32 PM
 To:   Ruben Roa
 Cc:   [EMAIL PROTECTED]; Duncan Murdoch; r-help@stat.math.ethz.ch
 Subject:  Re: [R] How to find statistics like that.
 
 On Thu, 10 Nov 2005, Ruben Roa wrote:
 
  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
 
 
 The sampling distribution of a p-value when the null hypothesis is true 
 can be given more simply by this R code:
 
 runif()
 
 That holds for any valid test, not just a t test, that produces p-values 
 distributed continuously on [0,1].  Discrete distributions can't quite do 
 that without special tweaking.
 
 Mike
 

Theorem 2.1.4 in Casella and Berger (1990, p. 52).
Ruben

__
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


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

2005-11-10 Thread Duncan Murdoch
On 11/10/2005 9:32 AM, Mike Miller wrote:
 On Thu, 10 Nov 2005, Ruben Roa wrote:
 
 
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
 
 
 
 The sampling distribution of a p-value when the null hypothesis is true 
 can be given more simply by this R code:
 
 runif()
 
 That holds for any valid test, not just a t test, that produces p-values 
 distributed continuously on [0,1].  Discrete distributions can't quite do 
 that without special tweaking.

Nor can most composite null hypotheses, e.g.

H0: mu = 0 versus H1: mu  0

A t-test may be an appropriate test, but its p-value is not uniformly 
distributed when mu is -1, even though the null is true.

Duncan Murdoch

__
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


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

2005-11-09 Thread Mike Miller
On Wed, 9 Nov 2005, Gao Fay wrote:

 Hi there,

 Suppose mu is constant, and error is normally distributed with mean 0 and 
 fixed variance s. I need to find a statistics that:
 Y_i = mu + beta1* I1_i beta2*I2_i + beta3*I1_i*I2_i + +error, where I_i is 1 
 Y_i is from group A, and 0 if Y_i is from group B.

 It is large when  beta1=beta2=0
 It is small when beta1 and/or beta2 is not equal to 0

 How can I find it by R? Thank you very much for your time.


That's a funny question.  Usually we want a statistic that is small when 
beta1=beta2=0 and large otherwise.

Why not compute the usual F statistic for the null beta1=beta2=0 and then 
use 1/F as your statistic?

Mike

__
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


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

2005-11-09 Thread Adaikalavan Ramasamy
I think an alternative is to use a p-value from F distribution. Even
tough it is not a statistics, it is much easier to explain and popular
than 1/F. Better yet to report the confidence intervals.

Regards, Adai



On Wed, 2005-11-09 at 17:09 -0600, Mike Miller wrote:
 On Wed, 9 Nov 2005, Gao Fay wrote:
 
  Hi there,
 
  Suppose mu is constant, and error is normally distributed with mean 0 and 
  fixed variance s. I need to find a statistics that:
  Y_i = mu + beta1* I1_i beta2*I2_i + beta3*I1_i*I2_i + +error, where I_i is 
  1 
  Y_i is from group A, and 0 if Y_i is from group B.
 
  It is large when  beta1=beta2=0
  It is small when beta1 and/or beta2 is not equal to 0
 
  How can I find it by R? Thank you very much for your time.
 
 
 That's a funny question.  Usually we want a statistic that is small when 
 beta1=beta2=0 and large otherwise.
 
 Why not compute the usual F statistic for the null beta1=beta2=0 and then 
 use 1/F as your statistic?
 
 Mike
 
 __
 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


__
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