Is the Share Different
In a poll, count of n people said yes. Return the p-value of the two-sided z-test of whether the true share of yes differs from share.
Example 1
count 50
n 100
share 0.5
returns 1.0
Exactly half said yes, which is just what a share of 0.5 predicts.
Constraints
20 <= n <= 20001 <= count <= n - 10.05 <= share <= 0.95
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More statsmodels problems
- Is the Slope RealEasy
- Prices for New RowsEasy
- Range for the SlopeEasy
- Two CausesEasy
- Better of Two ModelsMedium
- Chance of YesMedium
- Does One Change the OtherMedium
- Model for CountsMedium