Skip to content

Commit 70dc41f

Browse files
committed
Highly correlated covariates added
1 parent 623345b commit 70dc41f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

vignettes/Chapter06.Rmd

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ knitr::kable(round(cbind(qinvgamma(0.025,a=cN,b=reg.improp$CN), sigma2.hat,
153153
col.names = c("2.5% quantile", "posterior mean", "97.5% quantile"))
154154
```
155155

156-
# Exercise 6.3.
156+
### Exercise 6.3.
157157

158158
We now are interested in predicting of the box office sales on the opening
159159
weekend. We compute the predicted box office sales for a film with an average number of \emph{Screens} for a range of values for \emph{Budget}.
@@ -397,6 +397,7 @@ the effects of the Weeks and Screens. Together with the high value of the poster
397397
almost unshrunk.
398398

399399
## 6.3 Regression Analysis under the Semi-Conjugate Prior
400+
400401
We now include all available covariates in the regression analysis. As there is only one film with MPAA rating ``G'', we
401402
merge the two ratings ``G'' and ``PG'' into one category which we define as our
402403
baseline.
@@ -496,6 +497,19 @@ sigma2.sc<-post.draws$sigma2s
496497
res_sigma2.sc <- res.mcmc(sigma2.sc)
497498
names(res_sigma2.sc) <- colnames(res_beta.sc)
498499
knitr::kable(t(round(res_sigma2.sc, 3)))
500+
```
501+
502+
However the different signs of the
503+
effects of \emph{Vol-4-6} and \emph{Vol-1-3} deserve some further comment. The
504+
two covariates are highly correlated. Due to this high correlation the usual interpretation of the effect by changing the value of one covariate at the time does not make sense. Hence, we predict the change in box office sales for a film with twitter volume scores are 1 unit higher both in weeks 4-6 and weeks 1-3.
505+
506+
```{r}
507+
cor(X[,"Vol-4-6"], X[,"Vol-1-3"])
508+
509+
par(mfrow=c(1,1))
510+
plot(X[,"Vol-4-6"], X[,"Vol-1-3"])
511+
512+
print(res_beta.sc["Vol-4-6","Mean"]+res_beta.sc["Vol-1-3","Mean"])
499513
```
500514

501515
# 6.4 Regression Analysis Based on the Horseshoe Prior

0 commit comments

Comments
 (0)