dataorder.csv <http://r.789695.n4.nabble.com/file/n4681879/dataorder.csv> I have a set of data as attached.Like (181,246,378).....(180,228,378)And I want to use test for trend in proportions using (400,500,600) as denominator and get 119 p-valuesSo I use the code as below:data=read.table("dataorder.csv", sep=",", stringsAsFactors=F)i <-1:nrow(data)n <- c(400,500,600)e <- data[i,c(1,2,3)]prop.trend.test(e, n)allpvalue = apply(data, 1, function(x) { prop.trend.test(e, n)$p.value })However, there is something wrong but I can't figure out, can anybody help? Thanks -- View this message in context: http://r.789695.n4.nabble.com/How-to-use-multiple-test-for-trend-in-proportions-tp4681879.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
David Winsemius
2013-Dec-09 21:27 UTC
[R] How to use multiple test for trend in proportions?
On Dec 9, 2013, at 9:46 AM, celebrex wrote:> dataorder.csv <http://r.789695.n4.nabble.com/file/n4681879/dataorder.csv>> I have a set of data as attached.Like (181,246,378).....(180,228,378). And I > want to use test for trend in proportions using (400,500,600) as denominator > and get 119 p-values. So I use the code as > below:Reformatted:> > data=read.table("dataorder.csv", sep=",", stringsAsFactors=F) > > i<-1:nrow(data) > n <- c(400,500,600) > e <- data[i,c(1,2,3)]What is your intent with that command?> prop.trend.test(e, n) > > allpvalue = apply(data, 1, function(x) { prop.trend.test(e, n)$p.value})In the function body there is no reference to "x". Did you intend this: allpvalue = apply(data, 1, function(x) { prop.trend.test(x, n)$p.value})> However, there is something wrong but I can't figure out, can anybody > help? ThanksPosting from Nabble often screws up formatting, as it did big-time in your case. It is possible to post in plain text from Nabble, so you should now take the time to learn how to do that.> View this message in context: http://r.789695.n4.nabble.com/How-to-use-multiple-test-for-trend-in-proportions-tp4681879.html > Sent from the R help mailing list archive at Nabble.com.Nabble is NOT the Rhelp Mailing List!> [[alternative HTML version deleted]]And Nabble also deletes this very important message which you should now read and heed:>> R-help at 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.-- David Winsemius Alameda, CA, USA