# Initial Model Selection Testing
dfsub <- df %>% select(SPREAD, SP500, GOLD, OIL, CHHUSD, JPYUSD, RGDP, UNRATE, rec)
model <- glm(rec~SPREAD+SP500+GOLD+OIL+CHHUSD+JPYUSD+RGDP+UNRATE, data=df, family=binomial)
model.null = glm(rec ~ 1,
data=dfsub,
family = binomial)
anova(model, model.null, test="Chisq")
## Analysis of Deviance Table
##
## Model 1: rec ~ SPREAD + SP500 + GOLD + OIL + CHHUSD + JPYUSD + RGDP +
## UNRATE
## Model 2: rec ~ 1
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 161 69.248
## 2 169 145.444 -8 -76.197 2.84e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model)
##
## Call:
## glm(formula = rec ~ SPREAD + SP500 + GOLD + OIL + CHHUSD + JPYUSD +
## RGDP + UNRATE, family = binomial, data = df)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.88263 -0.31655 -0.14165 -0.06307 2.57136
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.505167 3.091098 0.810 0.4177
## SPREAD -0.746597 0.348426 -2.143 0.0321 *
## SP500 -0.001793 0.001037 -1.730 0.0837 .
## GOLD -0.002183 0.001910 -1.143 0.2532
## OIL 0.047323 0.025578 1.850 0.0643 .
## CHHUSD -0.771733 2.195895 -0.351 0.7253
## JPYUSD 0.005656 0.014900 0.380 0.7043
## RGDP -0.737730 0.171160 -4.310 1.63e-05 ***
## UNRATE -0.142725 0.346415 -0.412 0.6803
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 145.444 on 169 degrees of freedom
## Residual deviance: 69.248 on 161 degrees of freedom
## AIC: 87.248
##
## Number of Fisher Scoring iterations: 7
We are planning to use logistic regression, because we are interested in the predictors probability measure at particular levels. We believe this will help predict what to look at and when another recession could occur. For this project our response variable will be SPREAD or our recession indicator. We have many predictors at the moment, but we are still adding more and collecting more data and choosing the best predictors for our project. Some initial findings from this post is that real GDP, SPREAD, SP500, and OIL yielded the highest Z scores, which represents the notion these predictors influence our recession indicator the most. However, we see no real significance. Since our model does not fit the data really well, as our NUll deviance is 145.444 and AIC is 87.248, both are really high.