Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

FIN2028 Assignment 1

 

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

TIME

POPULATION

FERTILITY

GNI

Country Isocode

Year

Population in millions

Children/Woman

Gross national income in millions of US Dollars

 

 

link

link

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.

 

•    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   or GNIPERCAP = 15 or $15,000 per capita.

 

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


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)


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.