logo Use SA10RAM to get 10%* Discount.
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Abhishek MisraEconomics
(5/5)

594 Answers

Hire Me
expert
Robert DLaw
(4.8/5)

759 Answers

Hire Me
expert
Aryan BediComputer science
(5/5)

579 Answers

Hire Me
expert
Abhilekh Nath DasComputer science
(/5)

788 Answers

Hire Me
Python Programming
(5/5)

Use this function to calculate the correlation coefficient between age and risk.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

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^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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.

o 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.

o ii. Give the level of correlation, following Table 5.4 (Page 290) in Block 2 Part 5. 

o 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)

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme

Get Free Quote!

381 Experts Online