Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question is about Block 2 Part 5 . This question requires you to calculate values using Python functions. There are two approaches you can
This question is about Block Part 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 itRun 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 TMDTMAQfiles.zip go to TMA Python files and download TMDTMAQfiles.zip and unzip the file While you are working on this question, keep all the files in TMDTMAQfiles together in that folder. Moving files out of the folder may result in some of the code not working.Scenario:You work as a data analyst for a government agency that is responsible for tracking population and migration trends across different regions of the UK The agency has collected data on population estimates and new migrant GP registrations over several years for various regions. Your task is to calculate the mean population estimate for one particular region, and then to perform a correlation analysis to determine whether there is any relationship between the population estimates and the number of new migrant GP registrations in these regions.Open the folder TMDTMAQfiles and inspect the contents of qpyThe file contains two Python lists, each containing values. These lists contain data about population estimates, in thousands, and new migrant GP registrations, in thousands, for England over a span of years, ranging from to The list population contains population estimate in England by year and the list migrantregistration contains the new migrant GP registrations also by year. The data is from the Office for National Statistics ONSAs illustrated in Figure the statistics include the period before the coronavirus COVID pandemic in the UK specifically to The latest data includes a mix of data from preCOVID time up to March and from during the pandemic April to December The restrictions in place during the lockdown in the UK had direct impacts on population change at the national level. Global restrictions also impacted the volume of international migration to and from the UKFigure : The population estimate in England and the new migrant GP registrations between and The scale on lefthand vertical axis represents the population estimates, and that on the righthand vertical axis represents new migrant GP registrations.aqpy imports the Python function mean you used in Block Part to calculate the mean of a list of numbers.Use this function to find the mean of population.In your Solution document give the mean rounded manually or using Python to two decimal places. Also provide the Python code you used for calling the mean function and explain how you executed it marksbIn Section you were introduced to Plyas four stage process for problem solving. Consider the first three stages and for each describe, in one or two sentences, how it relates to the task of finding the mean which you have just completed. The fourth stage is looking back and of course you are doing that when you answer this question part! markscThe Python file qpy imports the function corrcoef which you used in Section of Block Part to calculate the correlation coefficient between two lists.iUse this function to calculate the correlation coefficient between population and migrantregistration.In your Solution document, provide the resulting figure rounded manually or using Python to two decimal places. Also provide the Python code you used for calling the corrcoef function and explain how you executed itiiClassify the size of the effect, following Table Page in Block Part iii.Briefly discuss whether any effect you have found is likely to be causal. Give one argument for it being causal and one against.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started