I am running a chi2 test in Stata, however I see the degreees of freedom may not be right. The data can be put as:
input str10 gender chocolat vainilla strawberry
"man" 15 10 15
"woman" 10 5 5
end
When running the test, as for example, in chocolat:
. tab gender chocolat, chi2
| chocolat
gender | 10 15 | Total
-----------+----------------------+----------
man | 0 1 | 1
woman | 1 0 | 1
-----------+----------------------+----------
Total | 1 1 | 2
Pearson chi2(1) = 2.0000 Pr = 0.157
The degress of freedom is calculated as 1. However, (rows-1)x(columns-1), is 2. What I am missing here?
input str10 gender chocolat vainilla strawberry
"man" 15 10 15
"woman" 10 5 5
end
When running the test, as for example, in chocolat:
. tab gender chocolat, chi2
| chocolat
gender | 10 15 | Total
-----------+----------------------+----------
man | 0 1 | 1
woman | 1 0 | 1
-----------+----------------------+----------
Total | 1 1 | 2
Pearson chi2(1) = 2.0000 Pr = 0.157
The degress of freedom is calculated as 1. However, (rows-1)x(columns-1), is 2. What I am missing here?
Comment