In: Statistics and Probability
USE R AND SHOW CODES
2. The following data were collected in a multisite observational study of medical effectiveness in Type II diabetes. These sites were involved: a healthy maintenance organization (HMO), a university teaching hospital (UTH), and an independent practice assumption (IPA). The following data display the treatment regimens of patients measured at baseline by site. Use the data to test that no difference in treatment regimens across sites. (in addition, calculate the expected frequency for each cell.)
Treatment regimen
Site Diet oral Hypoglycemic Insulin Total
HMO 294 827 579 1700
UTH 132 288 352 772
IPA 189 516 404 1109
Total 615 1631 1335 3581
The hypothesis being tested is:
H0: There is no difference in treatment regimens across sites
Ha: There is a difference in treatment regimens across sites
The R output is:
The R code is:
x <- matrix(c(294, 132, 189, 827, 288, 516, 579, 352,
404), nrow = 3)
chisq.test(x)
The expected frequencies are:
Col 1 | Col 2 | Col 3 | Total | ||
Row 1 | Observed | 294 | 827 | 579 | 1700 |
Expected | 291.96 | 774.28 | 633.76 | 1700.00 | |
Row 2 | Observed | 132 | 288 | 352 | 772 |
Expected | 132.58 | 351.61 | 287.80 | 772.00 | |
Row 3 | Observed | 189 | 516 | 404 | 1109 |
Expected | 190.46 | 505.10 | 413.44 | 1109.00 | |
Total | Observed | 615 | 1631 | 1335 | 3581 |
Expected | 615.00 | 1631.00 | 1335.00 | 3581.00 |
The p-value is 0.0000.
Since the p-value (0.0000) is less than the significance level (0.05), we can reject the null hypothesis.
Therefore, we can conclude that there is a difference in treatment regimens across sites.
Please give me a thumbs-up if this helps you out. Thank you!