Goodness of Fit
Type of Plot:
Bar Graph
Parameters: P1,P2,⋯,Pk
Point Estimates: ˆP1,ˆP2,…,ˆPk
Confidence Interval
does not apply
Hypothesis Test
Hypotheses:
\( H_0: P_1 = p_{1, 0}, P_2 = p_{2, 0}, \ldots, P_k = p_{k, 0} \)
\( H_a: \) At least one \( P_i \ne p_{i, 0} \) for \( i \in { 1, \ldots, k }\)
Test Statistic Random Variable (Assuming \(H_0\) is true):
\( X^2 = \sum_{\text{all cells}} \dfrac{\text{(observed - expected)}^2}{\text{expected}} \sim \chi^2 (df = k - 1) \)
Observed Test Statistic:
\( {x_{obs}}^2 = \sum_i \dfrac{(n_{obs, i} - n_{exp, i})^2}{n_{exp, i}} \)
\( \mathbf{\textit{P}}\)-value:
\( \mathbb{P}(X^2 \ge {x_{obs}}^2) \)
Conditions for Distributional Approximation (To \( \chi^2\)) (Assuming \( H_0 \) is true):
- Independent Observations
- All expected cell counts \( \ge 5 \)
- Degrees of freedom \( \ge 2 \)
qplot(x = response,
data = dataframe,
geom = "bar")