The answer should be by using R studio PLEASE ANSWER USING R studio The Data is
ID: 3798947 • Letter: T
Question
The answer should be by using R studio
PLEASE ANSWER USING R studio
The Data is here :
https://github.com/wampeh1/Ecog314_Spring2017/blob/master/midterm/nipa.csv
#The following questions use a quarterly time series data set containing National Income and Product Account (NIPA)
#data from the Bureau of Economic Analysis.
#
#Variables:
# DATE: quarterly date
# PCEC: nominal personal consumption expenditures (billions of dollars)
# GCE: nominal government spending (billions of dollars)
# NETEXP: nominal net exports (billions of dollars)
# GDPI: nominal investment (billions of dollars)
# GDPDEF: GDP price deflator
#Question 3.1
#Load the file nipa.csv into an R data frame object named "nipa"
#Question 3.2
#Rename the columns of nipa to: date, c, g, nx, i, gdpdef
#Question 3.3
#Convert the date column of nipa from a character vector to a date vector
#Question 3.4
#The GDP accounting identity is Y = C + I + G + NX
#Using this identity, create a column named "y" in the nipa data frame that is equal to c + i + g + nx
#Question 3.5
#The newly created column "y" is nominal GDP. To convert a nominal variable into a real variable, one must
#divide it by the product of a price deflator and 1/100. Create a variable in the nipa data frame named
#"ry" that is equal to real GDP.
#Question 3.6
#There is more than one way to extract and display a column of a data frame to the terminal.
#Display "ry" using two different methods.
#Question 3.7
#Using the plot function, create a line plot of real GDP.
#Question 3.8
#Economists often think about the nominal components of GDP in terms of their share of total nominal GDP to contextualize their size.
#This is often referred to as calculating the "nominal share" of a GDP component.
#Write a for loop that, for each component of nominal GDP c, i, g, and nx:
# i. Prints the variable name of the GDP component to the terminal
# ii. Calculates its nominal share
# iii. Calculates the standard deviation of the answer to part ii.
# iv. Prints the answer to part iii. to the terminal
#Which component of GDP is the most volatile? Save your answer to the provided object as a character vector equal to 'c', 'i', 'g', or 'nx'
aS3Q8 <-
#Question 3.9
#Create a new column of all missing values in the nipa data frame named "net".
#Then, use a for loop and a conditional statement to populate "net" with the string "importer" for quarters in which the U.S. was a net importer of goods and services,
#and "exporter" for quarters in which the U.S. was a net exporter of goods and services.
#Hint: Net exports is calculated as exports - imports.
#Question 3.10
#Perform a cross-tabulation that shows the number of quarters in which the U.S. was a net exporter and a net importer. Save your answer to the provided object.
aS3Q10 <-
Please just answer by R
Explanation / Answer
#Question 3.1 ##Loading the file nipa.csv into an R data frame object named "nipa" nipaRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.