## Not run:
#
# ###################################################
# ###################################################
#
# library("SemiParBIVProbit")
# data("meps", package = "SemiParBIVProbit")
#
# ###################################################
# # Bivariate brobit models with endogenous treatment
# ###################################################
#
# treat.eq <- private ~ s(bmi) + s(income) + s(age) + s(education) +
# as.factor(health) + as.factor(race) +
# as.factor(limitation) + as.factor(region) +
# gender + hypertension + hyperlipidemia + diabetes
# out.eq <- visits.hosp ~ private + s(bmi) + s(income) + s(age) +
# s(education) + as.factor(health) +
# as.factor(race) + as.factor(limitation) +
# as.factor(region) + gender + hypertension +
# hyperlipidemia + diabetes
#
# f.list <- list(treat.eq, out.eq)
# bpN <- SemiParBIVProbit(f.list, data = meps)
# bpF <- SemiParBIVProbit(f.list, data = meps, BivD = "F")
# bpC0 <- SemiParBIVProbit(f.list, data = meps, BivD = "C0")
# bpC180 <- SemiParBIVProbit(f.list, data = meps, BivD = "C180")
# bpJ0 <- SemiParBIVProbit(f.list, data = meps, BivD = "J0")
# bpJ180 <- SemiParBIVProbit(f.list, data = meps, BivD = "J180")
# bpG0 <- SemiParBIVProbit(f.list, data = meps, BivD = "G0")
# bpG180 <- SemiParBIVProbit(f.list, data = meps, BivD = "G180")
#
# conv.check(bpJ0)
#
# AIC(bpN, bpF, bpC0, bpC180, bpJ0, bpJ180, bpG0, bpG180)
#
# set.seed(1)
# summary(bpJ0, cm.plot = TRUE, cex.axis = 1.6,
# cex.lab = 1.6, cex.main = 1.7)
#
# #dev.copy(postscript, "contplot.eps")
# #dev.off()
#
# par(mfrow = c(2, 2), mar = c(4.5, 4.5, 2, 2),
# cex.axis = 1.6, cex.lab = 1.6)
# plot(bpJ0, eq = 1, seWithMean = TRUE, scale = 0, shade = TRUE,
# pages = 1, jit = TRUE)
#
# #dev.copy(postscript, "spline1.eps")
# #dev.off()
#
# par(mfrow = c(2, 2), mar = c(4.5, 4.5, 2, 2),
# cex.axis = 1.6, cex.lab = 1.6)
# plot(bpJ0, eq = 2, seWithMean = TRUE, scale = 0, shade = TRUE,
# pages = 1, jit = TRUE)
#
# #dev.copy(postscript, "spline2.eps")
# #dev.off()
#
# set.seed(1)
# AT(bpJ0, nm.end = "private", hd.plot = TRUE, cex.axis = 1.5,
# cex.lab = 1.5, cex.main = 1.6)
#
# #dev.copy(postscript, "hd.plotAT.eps")
# #dev.off()
#
# AT(bpJ0, nm.end = "private", type = "univariate")
#
# AT(bpJ0, nm.end = "private", type = "naive")
#
# ## End(Not run)
#
Run the code above in your browser using DataLab