Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

statistics - Is there an R function for finding differences in ChiSqr results

Here is an example contingency table using R

group = c("A","B","C","D","E")
Fail = c(424, 357, 324, 339, 160)
Pass = c(314, 263, 212, 252, 540)
Q1tab = data.frame(group, Fail, Pass)

From what i'm reading, I think I should be doing a Chi Sqr test.

chisq.test(Q1tab,correct=F)

#Output
Pearson's Chi-squared test

data:  Q1tab
X-squared = 272.99, df = 4, p-value < 2.2e-16

It shows significance but I have no idea where the differences are. With an ANOVA, I can use Tukey's but I can't here. I feel like I'm missing something basic - any help is appreciated.

question from:https://stackoverflow.com/questions/66047801/is-there-an-r-function-for-finding-differences-in-chisqr-results

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Check out the documentation for chisq.test ?chisq.test It tells you what you can get out of the function. In general with R, it best to save your test result to variable (ANOVA, linear regressions, t.tests etc) because there is always more information that what R prints out. They try to keep it simple for people who just want run some fast tests. See below for an example of what you can get from chisq.test.

results<-chisq.test(Q1tab,correct=F)
results$residuals #Pearson residuals
results$observed #observed counts
results$expected #expected counts

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...