r代写-FIN2028-Assignment 1
时间:2022-02-27

1

FIN2028 Assignment 1 (15%)
Tripti Sharma


Data
This assignment is based on the data in the file OECDdata.csv. The data is a panel dataset
containing information on the following variables:
Name Description doi
LOCATION Country Isocode
TIME Year
POPULATION Population in millions link
FERTILITY Children/Woman link
GNI Gross national income in millions of US Dollars link

Each student has been assigned a year of study. Please see accompanying file on Canvas
where your student number is matched to a year in these data. You could use “ctrl + f” for
searching your student number in this file.
Please email me immediately if your student number is missing from the list.

IMPORTANT
• You must work with your assigned year of study to answer a set of questions on Canvas.
These questions are available under “Quizzes”. Instructions on how to set up the data
in R and the list of questions asked on Canvas have been provided below.


2


• It is extremely important that you are working with your assigned year. The dataset
and file indicating your year of study are here –
https://canvas.qub.ac.uk/courses/16535/files/folder/Assignment%201.
• The analysis must be completed using R software.
• The assignment covers material from Weeks 1-5.
• You must submit your answers on Canvas by 5:00 pm, March 4th, 2022.
• This is an individual assignment. You must complete the work on your own.

Setup
Step 1
Load the data with the read. csv() function.
Step 2
Create a new “GNI per capita” variable called “GNIPERCAP”. This variable should measure
Gross National Income per capita (in thousands). If a country has a GNI = 15,000 and a
POPULATION = 1 then =
15,000
1×1,000
or GNIPERCAP = 15 or $15,000 per capita.
Use the mutate() function from the package dplyr.
Step 3
Filter your data so that the data frame you analyse consists only of observations for your given
year. Use the filter() function for this.
Answer the following questions. (100 marks in total)

Question 1
What is the
a) sample mean for fertility variable,
b) sample mean for GNI per capita variable,
c) standard deviation associated with the fertility variable,
d) standard deviation of GNI per capita,
e) standard error of the sample mean for fertility and
f) standard error of the sample mean for GNI per capita?
Use () and (). Remember that the standard error of the sample mean estimate is:
̅ = /√, and you can find out the sample size of a data variable with the function
ℎ().
(2.5 each = 15 marks)




3

Question 2
What is the correlation coefficient () measuring the relationship between fertility and GNI
per capita variables?
Use the () function.
(4 marks)

Question 3
Construct a 95% confidence interval around the mean of the fertility variable from part (1a).
The formula is: ̅ ± −1
∗ ̅ and you can look up the critical −1
∗ using the statistical tables
or with the function (0.975, = − 1) where is the sample size.
a) The lower confidence interval is -
b) The upper confidence interval is -
(20 marks)

Question 4
Is fertility below replacement? Evaluate this claim using a hypothesis test where 0 ∶ ̅ ≥ 2.1,
where is the total fertility rate.
a) What is the test t-test statistic? (6 marks)
b) Do you reject the null with = 0.05? Answer ‘1’ if you reject the null or ‘0’ if you
don’t. (10 marks)
c) What is the -value? (4 marks)
Use the . () function.

Question 5
Is fertility lower in wealthier countries? Let’s model Fertility as a function of GNI:
= 0 + 1 + . Estimate this bivariate model using the ()
function. What is the estimated slope: ̂1?
(21 marks)

Question 6
a) Generate the previous model’s residuals ̂ using () and then use these to
calculate the model = ∑ ̂2. (5 mark)
b) Calculate the total sum of squares: = ∑( − ̅)2. (5 mark)
c) Use the and to calculate the explained sum of squares . (5 mark)
d) What is the 2 statistic? (5 mark)


4

Hint
A good habit to get into to check if your regression estimates are correct is to eyeball the data
using a scatterplot. The code below produces the scatterplot for Income-Fertility in 1970 on
page 1. The scatterplot shows a slight negative relationship between income and fertility in
1970.


Note on plagiarism
This is an individual assignment requiring each student to undertake the task and complete it
on their own. Any suspicious collusion/collaboration/plagiarism patterns between students’
answers will be scanned and detected algorithmically. QUB plagiarism rules will apply if a
case of plagiarism is found.

Data Sources
OECD (2020), Gross national income (indicator). doi: 10.1787/8a36773a-en
OECD (2020), Population (indicator). doi: 10.1787/d434f82b-en
OECD (2020), Fertility rates (indicator). doi: 10.1787/8272fb01-en


essay、essay代写