@@ -26,12 +26,18 @@ par(mgp = c(1.6, .6, 0), mar = c(2.6, 2.6, 2.6, .4), lwd = 1)
2626
2727# Section 8.1
2828We illustrate probit regression analysis for the labor market data.
29+
2930``` {r}
3031library("BayesianLearningCode")
3132data("labor", package = "BayesianLearningCode")
3233```
3334We model the binary variable unemployment and use as covariates the variables female
35+ <<<<<<< HEAD
3436(binary), wcollar (binary) and age18 (quantitative, centered at 18 years)
37+ =======
38+ (binary), wcollar (binary) and age18 (quantitative, centered at 18 years).
39+
40+ >>>>>>> df0bb42b8beda50f0a11de8f9b6e3aeaa0daa1d2
3541``` {r}
3642y <- labor$unemp98
3743N <- length(y) # number of observations
@@ -42,6 +48,10 @@ X <- cbind("intercept" = rep(1, N), "female"=labor$female, "wcollar"=labor$wcoll
4248d <- dim(X)[2] # number regression effects
4349p <- d - 1 # number of regression effects without intercept
4450```
51+ <<<<<<< HEAD
52+ =======
53+
54+ >>>>>>> df0bb42b8beda50f0a11de8f9b6e3aeaa0daa1d2
4555 We specify the prior on the regression effects as a rather flat multivariate
4656Normal.
4757
@@ -51,6 +61,7 @@ B0.inv <- diag(rep(1 / 10000, d), nrow = d)
5161b0 <- rep(0, d)
5262B0inv.b0 <- iB0%*%b0
5363```
64+ <<<<<<< HEAD
5465The regression coefficients are estimated using data augmentation and Gibbs
5566sampling.
5667``` {r}
@@ -93,3 +104,8 @@ for (m in 1:(burnin + M)) {
93104}
94105```
95106
107+ =======
108+
109+ We estimate the regression coefficients using data augmentation and Gibbs
110+ sampling.
111+ >>>>>>> df0bb42b8beda50f0a11de8f9b6e3aeaa0daa1d2
0 commit comments