Applied statistics (AAL: GBE)

Frontpage Lecture plan Vidcasts Datasets Python install help

Contingency tables and Chi-squared test

Literature

[A] Chapter 8, except section 8.4-8.6.

Lecture material

This lecture as: slideshow (html), notes (pdf).

The entire module: notes (pdf).

Answers to exercises in the book

Exercises

  1. Exercise 8.5 - Use Python as a calculator
    Hint: use tab.div(tab.sum(axis=1), axis=0) and tab.div(tab.sum(axis=0), axis=1)
  2. Exercise 8.7 - Use Python as a calculator
    Hint: chi2.ppf(0.95, df) (remember from scipy.stats import chi2).
  3. In these exercises you can use the Jupyter Notebook file Agresti-8-13_and_8-16_and_8-33.ipynb which is on the server or can be downloaded here.
  4. The following is the beginning of an article in Politiken in 2007 (Google translation further below):

Assume for convenience that the number of interviewed people is 1000 in both 2005 and 2007 (and not 1001 as written in the article).

Google translation:

We are more afraid of flying

Flight is no longer considered as the safest mode of transport. Confidence in flight engineers has dropped. People now feel most comfortable in trains and ferries.

Three accidents SAS flights in September and October has made Danes more afraid of flying. A new study shows that trains and ferries has overtaken the plane, when it comes to the safest form of transport.

The Civil Aviation Administration (CAA) in September and October with the market research Epinion asked 1001 people about their perception of transport.

83 percent feel confident to fly. This is less than in 2005, when 86 percent felt safe in flight.