The degrees of freedom (df) for a contingency table are calculated using the formula:
\[ \text{df} = (r - 1) \times (c - 1) \]
where \( r \) is the number of rows and \( c \) is the number of columns.
In this case, we have 3 rows (Republican, Democrat,
Show more…