[R] Cochran-Armitage statistics

From: Martijn Brugman <mhbrugman_at_gmail.com>
Date: Thu 28 Dec 2006 - 14:26:38 GMT

Dear R-enthusiasts,

I am trying to do a Cochran-Armitage test for trend in R. After consulting google I found Torsten Hothorn's remark that the 'coin' library could be used.

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


In Peter Dalgaards Introductory statistics with R, a similar test for trends in proportions (prop.trend.test) is described (page 134). I wonder whether prop.trend.test and indepence_test are actually similar.
>From http://www-stat.stanford.edu/~rag/stat141/exs/nov17 and the example
above one would think so.

Since my dataset does not contain only integers (see below) I cannot get Torsten's example to work with my data. I would appreciate some help, and would like to excuse in advance if the answer is trivial. I am a noob, I know.

for example:
observed 5.5 5.0 5.5 3.5 11.0 9.5 16.0 21.5 15.0 24.5 expected 11.7 11.7 11.7 11.7 11.7 11.7 11.7 11.7 11.7 11.7

Thanks in advance,
MHB         [[alternative HTML version deleted]]

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 and provide commented, minimal, self-contained, reproducible code. Received on Fri Dec 29 01:46:02 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 28 Dec 2006 - 16:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.