Skip to content
Prev 75365 / 398502 Next

p-values

Spencer,

Here is an example from rayner and best 2001 and the script sent by 
Felipe.  This can be done as follows using the function durbin.grupos() 
in the attached file

 > ###Ice cream example from Rayner and Best 2001 . Chapter 7
 > judge <- rep(c(1:7),rep(3,7))
 > variety <- c(1,2,4,2,3,5,3,4,6,4,5,7,1,5,6,2,6,7,1,3,7)
 > cream <- c(2,3,1,3,1,2,2,1,3,1,2,3,3,1,2,3,1,2,3,1,2)
 > durbin.grupos(judge,variety,cream,k=3,r=3,alpha=0.01)

Prueba de Durbin
..............
Chi Cuadrado :  12
Gl.          :  6
P-valor      :  0.0619688
..............
Comparación de tratamientos

Alpha        :  0.01
Gl.          :  8
t-Student    :  3.355387
Diferencia minima
para la diferencia entre suma de rangos =  4.109493

Grupos, Tratamientos y la Suma de sus rangos
a        2       9
ab       1       8
abc      7       7
abc      6       6
abc      5       5
 bc      3       4
  c      4       3
  trat prom   M
1    2    9   a
2    1    8  ab
3    7    7 abc
4    6    6 abc
5    5    5 abc
6    3    4  bc
7    4    3   c
 >                              

You can see that the p-value is the same with

 > pchisq(12, df= 6, lower.tail=F)
[1] 0.0619688

I am hoping that someone, maybe Torsten, might be able to suggest how I 
can incorporate Monte-Carlo p-values using pperm().  The statistical 
issues are beyond my comprehension and I assume that Rayner and Best 
suggestion to use Monte-Carlo p-values instead of Chi-square p-values to 
be correct. In the above example the Monte-Carlo p-value is 0.02. This 
is a significant difference, resulting in the rejection of the null 
hypothesis when using Monte-Carlo p-values.

I hope this example might help. Thanks again for your answer and also to 
Felipe for sending the function for Durbin's test.



Peter
Spencer Graves wrote:

            
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Durbin.r
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050811/17206e5f/Durbin.pl