Are They Independent
table counts people by two answers: its rows are one question's answers and its columns the other's. Return the p-value of the chi-square test of independence between the two questions. Do not apply a continuity correction.
Example 1
table [[10,20],[20,40]]
returns 1.0
The second row is exactly twice the first, so the two answers are unrelated in this table.
Constraints
- 2 to 4 rows and 2 to 4 columns
- Every row and every column has a positive total
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More SciPy problems
- Break-Even RateMedium
- Cheapest PairingMedium
- Do the Groups DifferMedium
- Fit the DecayMedium
- Is the Mean DifferentMedium
- Lowest PointMedium
- Nearest Point to Each QueryMedium
- Range for the MeanMedium