I know the "formula" is (# rows - 1) * (# columns -1). However, shouldn't the design of the experiment or observational study being conducted make a difference?
The only experimental design I can think of where 1 d.f. makes sense to me is for a 2x2 table when both margins are fixed - such as in Fisher's famous "lady tasting tea" experiment. Since both margins are fixed, we only need to know 1 of the 4 values within the 2x2 table to fill in the rest of the table, so only 1 value within the table is "free to vary" and therefore 1 d.f.
But what if instead we have an observational study, where only the total number in the sample is known? Now we need to know 3 of the 4 values in the 2x2 table before we can fill in the last value. So in this case, 3 values are "free to vary" and therefore 3 d.f.?
And finally, if we have 2 separate samples where the number in each sample is fixed by design, we need to know 2 values in the table before we can fill in the remaining 2 values; 2 are "free to vary" so 2 d.f.?
Apologies if above betrays a naive/incorrect understanding of how degrees of freedom actually work. As I have attempted to research the topic, this idea of values that are "free to vary" made some intuitive sense to me, so I became curious as to why it wouldn't work as described above for chi-square tests.