Day 0¶
To start:
- Get a study number from me;
- Fill out this form.
Morning - data analysis is a dangerous business¶
The problem
- 10.00 - 10.45 - introduction to the course -
talk slides
[1]. - 10.45 - 11.00 - the Brexit problem.
- 11.00 - 11.10 - break.
- 11.10 - 11.40 - work on the Brexit problem.
- 11.40 - 12.00 - feed back.
2 hour break.
Afternoon - expressing steps in code¶
- 14.00 - 14.55 - Assignment.
- 14.30 - 14.55 - Introduction to Python, via Jupyter.
- 15.05 - 16.00 - the Brexit problem using Python and Jupyter.
There’s an expanded version of the Brexit analysis at Where are the Brexiteers?.
The Notebook I typed in in class is actual_brexit_notebook.ipynb
.
Homework¶
- Download the Notebook from Where are the Brexiteers?. Download the data to the same folder. Make sure you can run the Notebook without error.
- The Notebook replicates the calculation you have already done, showing that the proportion of Leave voters seems to be a lot smaller than the proportion in the referendum. Now imagine I represent the survey company. You tell me the proportion in the survey is too low, so my survey must have been biased to select Remain voters. I say the explanation is that I took a random sample of UK voters, and got them to give honest answers, but, by chance, my random sample happened to have more Remain voters than the general population. In other words, the proportion in the survey differs from the referendum due to “sampling error”. You disagree, and think the error is too great for this to be the explanation, but how will you convince me? We will go through your suggestions tomorrow.
- Use the Notebook to work out the average age of the Leave voters, and the average age of the Remain voters. You may need to explore the Notebook and Google to find out how to do this. Try search terms like “pandas” and “mean” and “column”. Is the difference you found a big difference or a small difference? How would you decide? Bring your Notebooks tomorrow.
[1] | Source files for building the slides, and source for all the pages in this website are always available in the course Github repository. |