[,1] [,2]
[1,] 2 71
[2,] 23 50
[3,] 36 37
Chapter 18
In response to buyer’s prompt, seller either discloses the known issue or does not.
Is the buyer’s question independent of whether the seller disclosed the problem?
We found expected counts for each group…
Then calculated \(\chi^2\)
\[ \chi^2 = \sum\frac{( O - E)^2}{E} \]
\[\begin{multline} \chi^2 = \frac{(2 - 20.33)^2}{20.33} + \frac{(23-20.33)^2}{20.33} + \\ \frac{(36-20.33)^2}{20.33} + \frac{(71 -52.67)^2}{52.67} + \\ \frac{(50-52.67)^2}{52.67} + \frac{(37-52.67)^2}{52.67} \\ = 40.13 \end{multline}\]
For larger datasets, it’s not practical to enter numbers by hand!
An experiment was run to evaluate three treatments for Type 2 Diabetes in patients aged 10-17 who were being treated with metformin. The three treatments considered were continued treatment with metformin (met), treatment with metformin combined with rosiglitazone (rosi), or a lifestyle intervention program. Each patient had a primary outcome, which was either lacked glycemic control (failure) or did not lack that control (success).
\(H_0\): treatment and outcome are independent
\(H_A\): there is a difference in outcomes between the treatments
failure success
lifestyle 109 125
met 120 112
rosi 90 143
infer
package# A tibble: 1 × 3
statistic chisq_df p_value
<dbl> <int> <dbl>
1 8.16 2 0.0169