Excerise 11: Investigating fraud

Needs to be completed and handed in by 30th April 23:59

Instructions:

This document contains information, questions, R code, and plots.

Hints and reminders are bold

Questions appear in blue.




In this exercise, the aim is to practice all of the modelling tools you learnt in this course. It is indicated how these questions might relate to an exam and how long an answer is required in each case. You can use the solution to grade your own work and then direct your revision.

You can decide how much help you want. For each question there is a general hint and an R hint (if applicable).

In the exam you will not get hints. So, now is a time to practice without!




R this week:

Things to remember:

New this week:







The challenge: Investigating fraud in the bird world.

Back in 1962 some British birders (people who spend a lot of time looking at rare birds) suspected that a lot of observations from around Hastings from betwen 1890 and 1930 were frauds. John Nelder (co-inventor of GLMs) took a look at the data, and compared Hastings with two nearby areas.

This 'scandal' even has it's own wikipedia page. The link is hidden, try to solve the mystery yourselves before looking at the answer.

Wikipedia

https://en.wikipedia.org/wiki/Hastings_Rarities

Your job is to find out whether there were more rare birds seen in Hastings than in surrounding areas before 1925 compared to after 1925?







The data

You have data on:

We are only looking at the rarest species, nationally categorised as “Very Rare”. We have numbers observed in nearby areas and the focus area (Hastings) from two time periods. The 'pre' time period is when we suspect fraud might have occurred, the 'post' time period is after.

Data can be found at: https://www.math.ntnu.no/emner/ST2304/2019v/Week13/HastingsData.csv it is a .csv file with column headers.

Remember to add stringsAsFactors = TRUE







Part A: Choosing an appropriate model

In this section, the aim is to practice explaining and justifying different modelling concepts.

Before you begin any analyses, you should to think about what steps you will need to conduct in order to reach a conclusion. This relates to the modelling process.

A1. What steps would you want to take to model the Hastings data? (at least 4 steps) (4 marks)

General hint

Think back to steps you've taken in previous analyses or look at Section G of last week's model for some prompts.

A2. What are the response and explanatory variable(s) and what data type are they, be specific? (4 marks)

General hint

Remember we have been introduced to several different data types. The main distinction is categorical/continuous. But continuous can be discrete or fully continuous.

A3. What model would you use for this data and why? Include which distribution you would choose for the random part and if you need a link function (say which if you do). (3 marks)

General hint

Think about all of the models we have covered in the course: distributions, linear models, T-tests, generalised linear models. Which works best here?

Then think about what distribution it is using for error.







Part B: Running the model

B1. How would you fit the model from A3 in R, write one line of code. (3 marks)

General hint: if you are not sure about the model

If you were not sure you got A3 correct: the key thing is that the response variable is count data. This will not be normally distributed in terms of error, so cannot be modelled with a linear model. We will need a GLM. A Poisson GLM with a log link is the appropriate chose for count data.

R hint

The code you need to edit slightly is in the R section of this document.

B2. Run the model in R (this would not be in the exam but it is helpful here).







Part C: Model selection

C1. How can you test the hypothesis: 'there is an interaction between Era and Area' i.e. Is the effect of area different before and after 1925? Include the name of the method you would use and say why you picked that method. (3 marks)

General hint

The hypothesis mentioned above is asking if there is an interaction. This is the same as asking which variables to include in a model. We have a specific idea of which variables we think are important, we are not testing lots of different ones. We need to find if including the interaction is needed and select the model that balances explanation and complexity.

R hint

The code you need to edit slightly is in the R section of this document. You won't need all the code listed, so pick the right part! It should take 2 lines.

C2. Run the method you chose for C1. What is your conclusion regarding the hypothesis? (again, in an exam you wouldn't run yourself in R)

General hint

Make sure to include support for your conclusion. Which part of the output did you use to make the choice?







Part D: Model checking

D1. What are the assumptions of this model? (I count 6) (so 6 marks)

General hint

These were listed in the GLM module but can also be found on google. There are several different ways to write them. But I am looking for approx. 6.

D2. How can we test these assumptions? (I expect 4 checks) (again 4 marks)

General hint

Just list the different methods here with the assumptions they test. You run them in the next part.

They are not all plots.

D3. Run the checks in R for your preferred GLM model. This should be decided by the outcome of C2 (again, wouldn't need to in an exam)

R hint

All the necessary code is at the top of this document.

D4. How good is the fit of the model based on your checks? (5 marks)

General hint

Go through each check and determine if the assumption is met.

D5. Would you want to improve it? If so, how? (2 marks)

General hint

Think about which assumption wasn't met. How do you fix it?

D6. Try an improvement. (would not be in exam)

R hint

The code for possible corrections is also included at the start of this document.







Part E: Conclusions

E1. Interpret the output (coefficient values) for your final model (the one you decided on in C2 and used in D). (14 marks)

General hint

Focus on the size of effects and whether they have statistical support, i.e. when we include uncertainty are we still clear about the direction? and remember to include the correct uncertainty numbers in your answer.

Deciding what this means for bird fraud is the next part.

E2. Do you think there was fraud going on in Hastings pre-1925? Explain your answer (5 marks)

We have plotted the data to help with this too. You can use this as well as the other information to support your conclusion.

General hint

Now use the interpretation you had before to draw a conclusion.

plot of chunk unnamed-chunk-8







Part F: Reflection

F1. Think about how this went. Were you still using most of the hints? What were you still unsure of?

F2. Are there some areas you want to prioritise for revision?

F3. Is there anything you are very proud of from your group?

F4. Anything specific for your final feedback?