On Dec 12, 2008, at 8:57 AM, Peter Dalgaard wrote:

Chuck Cleland wrote:
On 12/12/2008 3:29 AM, robert-mcfad...@o2.pl wrote:
Hello,
Which package allows to use Cochrana-Armitage trend test? I tried to search for but I found only package coin in which there is no explicit function.

 But there is this example in coin:

### Cochran-Armitage trend test for proportions
### Lung tumors in female mice exposed to 1,2-dichloroethane
### Encyclopedia of Biostatistics (Armitage & Colton, 1998),
### Chapter Trend Test for Counts and Proportions, page 4578, Table 2
lungtumor <- data.frame(dose = rep(c(0, 1, 2), c(40, 50, 48)),
                       tumor = c(rep(c(0, 1), c(38, 2)),
                                 rep(c(0, 1), c(43, 7)),
                                 rep(c(0, 1), c(33, 15))))
table(lungtumor$dose, lungtumor$tumor)

### Cochran-Armitage test (permutation equivalent to correlation
### between dose and tumor), cf. Table 2 for results
independence_test(tumor ~ dose, data = lungtumor, teststat = "quad")

 See the following:

http://finzi.psych.upenn.edu/R/library/coin/html/ ContingencyTests.html


Also prop.trend.test().

There seems to be a subtle difference, though:

independence_test(tumor ~ dose, data = lungtumor, teststat = "quad")

       Asymptotic General Independence Test

data:  tumor by dose
chi-squared = 10.6381, df = 1, p-value = 0.001108


tt <- table(lungtumor$dose, lungtumor$tumor)
prop.trend.test(tt[,2],rowSums(tt))

       Chi-squared Test for Trend in Proportions

data:  tt[, 2] out of rowSums(tt) ,
using scores: 1 2 3
X-squared = 10.7157, df = 1, p-value = 0.001062


Anyone have a guess at what the difference is? (Just curious.)

My guess is that this is the difference between a rank-correlation test and a score based linear correlation test. I just looked at chapter 13 of "Medical Uses of Statistics" in which Moses, Emerson and Hosseini describe using a Wilcoxon statistic to tackle this problem. That appears to be equivalent to the permutation method implemented in the independence_test(). The authors of coin call it an equivalent rather than a "faithful" implemention.

My examination of the Armitage formula in his "Statistical Methods in Medical Research" (which appears to be what you implemented in prop.trend.test) did not lead me to think it was a rank or permutation based method.

I don't have JSTOR access, but if you do, a relevant citation for the permutation method appears to be:
<http://www.jstor.org/pss/2530667>

--
David Winsemius, MD
Heritage Labs


        -pd



 There also is an implementation in the GeneticsBase package
(Bioconductor).

Best,
RobMac

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
  O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
 c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to