Take the 2-minute tour ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Concerning the Pearson chi-square test there seems to be a subtle difference between the goodness-of-fit test and the test of independence.

What is confusing is that both tests seem to be calculated in a very similar way.

My question: What is the real difference and how to handle that in practice?

(NB: This is question is related, yet not the same: Test of independence vs test of homogeneity)

share|improve this question
1  
Note chisq.test performs one or the other depending on its arguments - read the manual. –  Scortchi Mar 31 at 7:31
    
@Scortchi: Edited the question accordingly - thank you. –  vonjd Mar 31 at 8:25

1 Answer 1

up vote 3 down vote accepted

1) A goodness of fit test is for testing whether a set of multinomial counts is distributed according to a prespecified (i.e. before you see the data!) set of population proportions.

2) A test of homogeneity tests whether two (or more) sets of multinomial counts come from different sets of population proportions.

3) A test of independence tests is for a bivariate** multinomial, of whether $p_{ij}$ is different from $p_{i}\,p_{j}$.

**(usually)

Sometimes people make the mistake of treating the second case as if it were the first. This underestimates the variability between the proportions. (If one sample is very large the error in treating it as population proportions will be relatively small.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.