An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130617/2d59134b/attachment.pl>
chi square test
4 messages · Dave Clark, R. Michael Weylandt, Peter Dalgaard
On Mon, Jun 17, 2013 at 9:14 AM, Dave Clark <dave at mailbox.co.uk> wrote:
I`m doing the chi square test in R, see below code:
row1 <- c(27,17,13,21,80,24,35,41,18,51) #Category A (1-10) counts row2 <- c(27,11,26,13,30,28,17,30,10,21) #Category B (1-10) counts data.table <- rbind(row1,row2) data.table
then:
chisq.test(data.table)
This gives me the chi figure, degrees of freedom and p value. But how do I get the results of individual cells?
What do you mean 'results of individual cells'? As documented in ?chisq.test, you might be looking for one or more of data.table$observed data.table$expected data.table$residuals data.table$stdres Pick your poison. ;-) MW
And has anyone got any good ideas on a decent post hoc test to the chi
square test.
Thanks all in advance,
Dave Clark
[[alternative HTML version deleted]]
______________________________________________ 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.
On Jun 17, 2013, at 10:36 , R. Michael Weylandt wrote:
On Mon, Jun 17, 2013 at 9:14 AM, Dave Clark <dave at mailbox.co.uk> wrote:
I`m doing the chi square test in R, see below code:
row1 <- c(27,17,13,21,80,24,35,41,18,51) #Category A (1-10) counts row2 <- c(27,11,26,13,30,28,17,30,10,21) #Category B (1-10) counts data.table <- rbind(row1,row2) data.table
then:
chisq.test(data.table)
This gives me the chi figure, degrees of freedom and p value. But how do I get the results of individual cells?
What do you mean 'results of individual cells'? As documented in ?chisq.test, you might be looking for one or more of data.table$observed data.table$expected data.table$residuals data.table$stdres Pick your poison. ;-) MW
Replace with chisq.test(data.table)$observed, etc.
Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
On Mon, Jun 17, 2013 at 10:07 AM, peter dalgaard <pdalgd at gmail.com> wrote:
On Jun 17, 2013, at 10:36 , R. Michael Weylandt wrote:
What do you mean 'results of individual cells'? As documented in ?chisq.test, you might be looking for one or more of data.table$observed data.table$expected data.table$residuals data.table$stdres Pick your poison. ;-) MW
Replace with chisq.test(data.table)$observed, etc.
D'Oh! Thanks for that, Peter. MW