Re: [R] Chi square test on data frame

2011-08-18 Thread Petr PIKAL
Kings College London From: R. Michael Weylandt [michael.weyla...@gmail.com] Sent: Wednesday, August 17, 2011 7:11 PM To: Bansal, Vikas Cc: r-help@r-project.org Subject: Re: [R] Chi square test on data frame I think everything below is right

Re: [R] Chi square test on data frame

2011-08-18 Thread Uwe Ligges
If your data is d1: temp - apply(d1[,1:4], 1, order, decreasing=TRUE)[1:2,] temp - rbind(temp, temp+4) result - sapply(1:nrow(d1), function(i) chisq.test(matrix(as.matrix(d1[i,temp[,i]]), ncol=2))) Uwe Ligges On 16.08.2011 23:26, Bansal, Vikas wrote: Dear all, I have been working on

Re: [R] Chi square test on data frame

2011-08-18 Thread R. Michael Weylandt
-project.org Subject: Re: [R] Chi square test on data frame I think everything below is right, but it's all a little helter-skelter so take it with a grain of salt: First things first, make your data with dput() for the list. Y = structure(c(0, 35, 0, 0, 0, 0, 84, 84, 0, 48, 84, 0

[R] Chi square test on data frame

2011-08-17 Thread Bansal, Vikas
Is there anyone who can help me with chi square test on data frame.I am struggling from last 2 days.I will be very thankful to you. Dear all, I have been working on this problem from so many hours but did not find any solution. I have a data frame with 8 columns- V1 V2 V3

Re: [R] Chi square test on data frame

2011-08-17 Thread R. Michael Weylandt
I think everything below is right, but it's all a little helter-skelter so take it with a grain of salt: First things first, make your data with dput() for the list. Y = structure(c(0, 35, 0, 0, 0, 0, 84, 84, 0, 48, 84, 0, 22, 0, 0, 0, 0, 0, 10, 0, 48, 0, 0, 48, 0, 22, 0, 0, 0, 0, 84, 84, 0, 48,

Re: [R] Chi square test on data frame

2011-08-17 Thread Bansal, Vikas
7:11 PM To: Bansal, Vikas Cc: r-help@r-project.org Subject: Re: [R] Chi square test on data frame I think everything below is right, but it's all a little helter-skelter so take it with a grain of salt: First things first, make your data with dput() for the list. Y = structure(c(0, 35, 0, 0, 0

[R] Chi square test on data frame

2011-08-16 Thread Bansal, Vikas
Dear all, I have been working on this problem from so many hours but did not find any solution. I have a data frame with 8 columns- V1 V2 V3 V4 W1 W2W3 W4 1 084 22 10 0 84 0 0 235840