Use R Studio to answer the following
(HINT: first make a data frame with four columns and three rows. See the example in the notes with the three shifts and four grades of lumber.)
|
Medical Clinic |
||||
|
Patient Age |
A |
B |
C |
D |
|
0-18 |
35 |
28 |
37 |
42 |
|
19-30 |
20 |
22 |
34 |
26 |
|
>30 |
12 |
8 |
10 |
6 |
R Code
Creation of data matrix
data=matrix(c(35,28,37,42,20,22,34,26,12,8,10,6), nrow = 3, ncol =
4,byrow=TRUE,dimnames = list(c("0-18","19-30",">30"),
c("A","B","C","D")))
# Chi square test
chisq <- chisq.test(data)
# p value
chisq$p.value
Now p value is 0.5095548 which is greater than 0.05 (level of
significance)
So we do not reject H0 and conclude that clinic and patient age are
independent.
Use R Studio to answer the following Four medical clinics (A, B, C, D) conducted a...