Analysing Proportions Flashcards
(11 cards)
What is binomial test and its conditions
A binomial test compares the observed number of “successes” in a fixed number of trials to what we’d expect under a given probability.
Conditions:
Fixed number of trials 𝑛
Two outcomes per trial: Success/Failure
Constant probability of success 𝑝
Independent trials
What is the binomial probability formula
𝑃 (𝑋 = 𝑥) = (𝑛 / 𝑥) 𝑝ˣ (1-𝑝)ⁿ⁻ˣ
May need to calculate cumulative probability for “more extreme” results (e.g. 𝑃 (𝑋 ≥ 𝑥))
What are the steps in performing a binomial test
- Define 𝐻0 and 𝐻𝐴
- Find 𝑥
- Use binomial formula
- Calculate p-value
- Compare to α.
How do you calculate a sample proportion
Divide the number of successes 𝑥 by the total sample size 𝑛
How do you calculate the 95% CI for proportion using the Agresti-Coull method
- Add 2 successes and 4 to the total:
𝑥~ = 𝑥 + 2, 𝑛~ = 𝑛 + 4 - Compute adjusted proportion:
𝑝~ = (𝑥~)/(𝑛~) - Calculate the standard error:
SE = (√𝑝~(1 - 𝑝~))/𝑛~ - Find margin of error:
𝑀𝐸 = z∗ x SE
95% CI z∗ =1.96 - Final confidence interval:
𝑝~ ± 𝑀𝐸
How do you calculate the Chi-Squared test statistic
χ² = ∑ (𝑂𝑖 - 𝐸𝑖)² / 𝐸𝑖
Where
𝑂𝑖 : observed count
𝐸𝑖 : expected count
How do calculate degrees of freedom for a goodness of fit test (chi-squared)
df = 𝑘−1
Where
𝑘 = number of categories
How do calculate degrees of freedom for a contingency table (chi-squared)
df = (𝑟 -1)(𝑐−1)
Where
𝑟 = rows,
𝑐 = columns
What is Poisson’s distribution
For counting number of events in fixed time/space, with known average rate 𝜆.
What is the formula for Poisson’s distribution
P(X = k) = (e^⁻λ x λᵏ )/k!
Where:
k = number of events
λ = expected number
e = eulers constant approx = 2.718
How do you use a chi-squared to test for poisson fit
- Estimate λ = sample mean
- Use Poisson formula to find expected proportions
- Multiply by total n (expected counts)
- Group rare values (<5) together if needed
- Use χ² formula to compare observed vs expected
- Degrees of freedom = categories – 2 (1 for count loss, 1 for estimating λ)