# \donttest{
## Probit model
data("Workmroz")
probit <- Rchoice(lfp ~ k5 + k618 + age + wc + hc + lwg + inc,
data = Workmroz, family = binomial('probit'))
summary(probit)
## Poisson model
data("Articles")
poisson <- Rchoice(art ~ fem + mar + kid5 + phd + ment, data = Articles, family = poisson)
summary(poisson)
## Ordered probit model
data("Health")
oprobit <- Rchoice(newhsat ~ age + educ + hhinc + married + hhkids,
data = Health, family = ordinal('probit'), subset = year == 1988)
summary(oprobit)
## Poisson Model with Random Parameters
poisson.ran <- Rchoice(art ~ fem + mar + kid5 + phd + ment,
data = Articles, family = poisson,
ranp = c(kid5 = "n", phd = "n", ment = "n"))
summary(poisson.ran)
## Poisson Model with Correlated Random Parameters
poissonc.ran <- Rchoice(art ~ fem + mar + kid5 + phd + ment,
data = Articles,
ranp = c(kid5 = "n", phd = "n", ment = "n"),
family = poisson,
correlation = TRUE,
R = 20)
summary(poissonc.ran)
## Hierarchical Poisson Model
poissonH.ran <- Rchoice(art ~ fem + mar + kid5 + phd + ment | fem + phd,
data = Articles,
ranp = c(kid5 = "n", phd = "n", ment = "n"),
mvar = list(phd = c("fem"), ment = c("fem", "phd")),
family = poisson,
R = 10)
summary(poissonH.ran)
## Ordered Probit Model with Random Effects and Random Parameters
Health$linc <- log(Health$hhinc)
oprobit.ran <- Rchoice(newhsat ~ age + educ + married + hhkids + linc,
data = Health[1:2000, ],
family = ordinal('probit'),
ranp = c(constant = "n", hhkids = "n", linc = "n"),
panel = TRUE,
index = "id",
R = 10,
print.init = TRUE)
summary(oprobit.ran)
# }
Run the code above in your browser using DataLab