Nothing
## ----preliminaries, echo = FALSE, message = FALSE, results = "hide"------
library("htobit2018")
library("car")
library("crch")
library("lmtest")
library("memisc")
## ----verbeek-------------------------------------------------------------
data("AlcoholTobacco", package = "htobit2018")
library("htobit2018")
ma <- htobit(alcohol ~ (age + adults) * log(expenditure) + oldkids + youngkids, data = AlcoholTobacco)
summary(ma)
## ----restrictions--------------------------------------------------------
library("car")
linearHypothesis(ma, "oldkids = youngkids")
linearHypothesis(ma, "oldkids = adults")
## ----alternative---------------------------------------------------------
AlcoholTobacco$persons <- with(AlcoholTobacco, adults + oldkids + youngkids)
ma2 <- htobit(alcohol ~ (age + adults) * log(expenditure) + oldkids + youngkids |
(age + adults) * log(expenditure) + oldkids + youngkids, data = AlcoholTobacco)
ma3 <- htobit(alcohol ~ age + log(expenditure) + persons | age + log(expenditure) + persons, data = AlcoholTobacco)
BIC(ma, ma2, ma3)
## ----lrtest--------------------------------------------------------------
library("lmtest")
lrtest(ma, ma2, ma3)
## ----crch----------------------------------------------------------------
library("crch")
ca3 <- crch(alcohol ~ age + log(expenditure) + persons | age + log(expenditure) + persons,
data = AlcoholTobacco, left = 0)
## ----mtable--------------------------------------------------------------
library("memisc")
mtable("htobit" = ma3, "crch" = ca3)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.