Answer To: Econ 7011C: Econometrics for Finance Fall 2022 Homework 3 Answer to question no 1 Answer to...
Mohd answered on Oct 24 2022
-
-
-
2022-10-24
library(readr)
Fred_data <- read_csv("Fred_data.csv", col_types = cols(DATE = col_date(format = "%m/%d/%Y")))
View(Fred_data)
model_1<-lm(Unemployment_Rate~CPI,data=Fred_data)
model_2<-lm(Unemployment_Rate~PCE,data=Fred_data)
model_3<-lm(PCE~CPI,data=Fred_data)
model_4<-lm(PCE~CPI+Unemployment_Rate,data=Fred_data)
summary(model_1)
##
## Call:
## lm(formula = Unemployment_Rate ~ CPI, data = Fred_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.6000 -1.1571 -0.1901 0.3581 9.3738
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.0239 0.5154 13.629< 2e-16 ***
## CPI -0.7601 0.1905 -3.991 0.000124 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.702 on 103 degrees of freedom
## Multiple R-squared: 0.1339, Adjusted R-squared: 0.1255
## F-statistic: 15.92 on 1 and 103 DF, p-value: 0.0001236
summary(model_2)
##
## Call:
## lm(formula = Unemployment_Rate ~ PCE, data = Fred_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.4976 -1.0211 -0.4509 0.4673 9.3972
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.998e+00 1.187e+00 5.897 4.75e-08 ***
## PCE -1.403e-04 8.572e-05 -1.636 0.105
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.806 on 103 degrees of freedom
## Multiple R-squared: 0.02534, Adjusted R-squared: 0.01588
## F-statistic: 2.678 on 1 and 103 DF, p-value: 0.1048
summary(model_3)
##
## Call:
## lm(formula = PCE ~ CPI, data = Fred_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -15370.3 -1171.2 110.4 926.8 2584.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 12568.4 617.5 20.36<2e-16 ***
## CPI 438.2 228.2 1.92 0.0576 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2039 on 103 degrees of freedom
## Multiple R-squared: 0.03456, Adjusted R-squared: 0.02519
## F-statistic: 3.687 on 1 and 103 DF, p-value: 0.05759
summary(model_4)
##
## Call:
## lm(formula = PCE ~ CPI + Unemployment_Rate, data = Fred_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -15210.8 -1183.0 -3.4 1126.7 2574.8
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 13407.4 1033.7 12.970<2e-16 ***
## CPI 347.4 245.2 1.417 0.160
## Unemployment_Rate -119.4 118.0 -1.012 0.314
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2039 on 102 degrees of freedom
## Multiple R-squared: 0.04416, Adjusted R-squared: 0.02541
## F-statistic: 2.356 on 2 and 102 DF, p-value: 0.09994
library(tseries)
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
adf.test(Fred_data$CPI)
## Warning in adf.test(Fred_data$CPI): p-value greater than printed p-value
##
## Augmented Dickey-Fuller Test
##
## data: Fred_data$CPI
## Dickey-Fuller = 0.85597, Lag order = 4, p-value = 0.99
## alternative hypothesis: stationary
acf(Fred_data$CPI)
adf.test(Fred_data$Unemployment_Rate)
##
## Augmented Dickey-Fuller Test
##
## data: Fred_data$Unemployment_Rate
## Dickey-Fuller = -2.7089, Lag order = 4, p-value = 0.2827
## alternative hypothesis: stationary
acf(Fred_data$Unemployment_Rate)
adf.test(Fred_data$PCE)
##
## Augmented Dickey-Fuller Test
##
## data: Fred_data$PCE
## Dickey-Fuller = -2.7877, Lag order = 4, p-value = 0.25
## alternative hypothesis: stationary
acf(Fred_data$PCE)
skimr::skim(Fred_data)
Data summary
Name
Fred_data
Number of rows
105
Number of...