Chat with us, powered by LiveChat The Correlation Coefficient Between Age and Infection Risk Python Coding Task - Essayabode

The Correlation Coefficient Between Age and Infection Risk Python Coding Task

This question is about Block 2 Part 5. This question requires you to calculate values using Python functions. There are two approaches you can use.

  • add suitable code to the provided file, then run it.
  • run the provided file first, to load the required function and data into memory, then do the calculation in the interactive Python shell.

Feel free to choose the approach you prefer.

The download folder for this TMA contains TM112_22D_TMA02_Q5_files.zip (go to TMA02 - Python files and download TM112_22D_TMA02_Q5_files.zip and unzip the file). While you are working on this question, keep all the files in TM112_22D_TMA02_Q5_files together in that folder. Moving files out of the folder may result in some of the code not working.

Open the folder TM112_22D_TMA02_Q5_files and inspect the contents of q5.py

The file contains two Python lists, each containing 70 values. These lists contain data about the estimated risk of infection following vaccination by a single year of age in the UK.

The TMA02 - Python files data set is from the Office for National Statistics (Office for National Statistics, June 2021)

The list age holds data about the years of age. The list risk holds data about the estimated risk of infection following vaccination by single year of age, collected between 1 December 2020 and 31 May 2021. All estimates are subject to uncertainty, given that a sample is only part of the wider population.

These statistics show that the estimated risk of infection decreases with age. For example, for vaccinated people, the risk of infection to those aged 55 is half compared to the 16-year-old.

Figure 2 Estimated risk of infection following vaccination by single year of age, UK. (December 2020 to May 2021). Note that single year of age (SYOA) demographics are single year of age population (e.g. age 1, age 2, etc.)

  • a.q5.py imports the Python function mean() you used in Block 2 Part 5 to calculate the median of a list of numbers.Use this function to find the mean of age.In your Solution document give the mean. Also provide the Python code you used for calling the mean() function and explain how you executed it.(4 marks)
  • b.The Python file q5.py imports the function corr_coef() which you used in Section 5.4 of Block 2 Part 5 to calculate the correlation coefficient between two lists.

    • i.Use this function to calculate the correlation coefficient between age and risk.In your Solution document, provide the resulting figure rounded manually to two decimal places. Solutions which use Python to round the result will not gain credit. Also provide the Python code you used for calling the corr_coef() function and explain how you executed it.
    •  
    • ii.Give the level of correlation, following Table 5.4 (Page 290) in Block 2 Part 5.
    •  
    • iii.Briefly discuss whether any effect you have found is likely to be causal. Give one argument for it being causal and one against.The maximum word limit for Question 5.b(iii) is 100 words.(10 marks)(Total 14 marks)

References

Office for National Statistics (2021) Coronavirus (COVID-19) Infection Survey technical article: analysis of positivity after vaccination data: 17 June. Available at: https://www.ons.gov.uk/ peoplepopulationandcommunity/ healthandsocialcare/ conditionsanddiseases/ datasets/ coronaviruscovid19infectionsurveytechnicalarticleanalysisofpositivityaftervaccinationdata (Accessed: 24 August 2021).

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?