WB-ILIAS | Weiterbildung und offene Bildungsressourcen

R

Chi-squared test

The chi-squared test is used when comparing the counts, rather than scores. It tests whether there is a significant difference between expected and observed frequencies in one or more categories. A prototypical usage in linguistics is when comparing the frequencies of a phenomenon in two corpora representing different time windows.

To perform the chi-square test, use the function chisq.test(). It should be given two parameters: the vector where one of the values is stored (e.g. “female” or“male”) and another vector of matching length where the paired value is found (e.g. the education level of that subject).

Thus, to see whether the differences we observed through the ftable() functions earlier are significant, we will type in the chi-squared test like this:

chisq.test(data$education, data$gender)

The result should look like this:

The output again gives us the most important information: the p-value, degrees of freedom and the chi-squared statistic. From what you already know, you should recognize that even though the individual education levels are not uniformly distributed in our data, this difference is not as extreme as to consider the data unbalanced.

qtitle
qtitle
qcloze


Bisher wurde noch kein Kommentar abgegeben.