Presentation is loading. Please wait.

Presentation is loading. Please wait.

Contingency tables. X = (Y, Z)T is 2-dimensional random vector.

Similar presentations


Presentation on theme: "Contingency tables. X = (Y, Z)T is 2-dimensional random vector."— Presentation transcript:

1 Contingency tables. X = (Y, Z)T is 2-dimensional random vector. Y contains r objects, Z contains c objects. Probabilities pij = P(Y= i, Z = j). Let nij are number of cases, where 𝑖∈𝑌, 𝑗∈𝑍. Example. There were randomly selected 200 Czechs, 300 Norwegians and 150 Turks. 50 Czechs, 70 Norwegians and 80 Turks are smokers. Does smoking depend on the state? Randomly selected people are divided according to 2 criteria: Y … we have 3 groups according to the state. Z … we have 2 possibilities for smoking r = 3, c = 2 Criteria Y and Z are independent if pij = pi. p.j, where pi. means the raw i in the table, p.j denotes the column j in the table. pij means the probability that random selected person is from the state i and his smoking status is j.

2 We are testing H0: Y and Z are independent and H1: Y and Z are dependent (are not independent) Assuming the validity of H0, the frequency table is (expected frequencies): P(Czech,yes) = P(Czech)P(yes) = 200/650 * 200/650 = (expected frequency: *650) P(Czech,no) = P(Czech)P(no) = 200/650 * 450/650 = (expected frequency: *650) P(Norway,yes) = P(Norway)P(yes) = 300/650 * 200/650 = (expected frequency: *650) P(Norway,no) = P(Norway)P(no) =300/650 * 450/650 = (expected frequency: *650) P(Turkey,yes) = P(Turkey)P(yes) = 150/650 *200/650 = (expected frequency: *650) P(Turkey,no) = P(Turkey)P(no) = 150/650 *450/650 = (expected frequency: *650) Expected frequencies are:

3 c2 test with df = (number of rows – 1)*(number of columns -1):
In our example: , P < Conclusion: We will reject H0, therefore smoking is depending on the state. (It was found that smoking in Norway is less than expected and in Turkey more than expected.) Fisher’s factorial test is performed for frequencies lesser or equal to 5.

4 Examples. In 27 randomly selected patients with a disease, it was determined whether they had been vaccinated against the disease and the course of the disease. Vaccination + heavy course 2, vaccination + light course 10, non-vaccination + severe course 11, non-vaccination + moderate course 4 There were selected 200 inhabitants of Ostrava, 150 inhabitants of České Budějovice and 500 inhabitants of Prague. It was found that 20 inhabitants of Ostrava, 20 inhabitants of Budějovice and 100 inhabitants of Prague suffer from kidney disease. Does kidney disease depend on the place?


Download ppt "Contingency tables. X = (Y, Z)T is 2-dimensional random vector."

Similar presentations


Ads by Google