# \donttest{
# Data set
data(oldcol, package = "spdep")
# Create dependent (dummy) variable
COL.OLD$CRIMED <- as.numeric(COL.OLD$CRIME > 35)
# Two-step (Probit) GMM estimator
ts <- sbinaryGMM(CRIMED ~ INC + HOVAL,
link = "probit",
listw = spdep::nb2listw(COL.nb, style = "W"),
data = COL.OLD,
type = "twostep",
verbose = TRUE)
# Robust standard errors
summary(ts)
# Efficient standard errors
summary(ts, vce = "efficient")
# One-step (Probit) GMM estimator
os <- sbinaryGMM(CRIMED ~ INC + HOVAL,
link = "probit",
listw = spdep::nb2listw(COL.nb, style = "W"),
data = COL.OLD,
type = "onestep",
verbose = TRUE)
summary(os)
# One-step (Logit) GMM estimator with identity matrix as initial weight matrix
os_l <- sbinaryGMM(CRIMED ~ INC + HOVAL,
link = "logit",
listw = spdep::nb2listw(COL.nb, style = "W"),
data = COL.OLD,
type = "onestep",
winitial = "identity",
verbose = TRUE)
summary(os_l)
# Two-step (Probit) GMM estimator with WX
ts_wx <- sbinaryGMM(CRIMED ~ INC + HOVAL| INC + HOVAL,
link = "probit",
listw = spdep::nb2listw(COL.nb, style = "W"),
data = COL.OLD,
type = "twostep",
verbose = FALSE)
summary(ts_wx)
# Constrained two-step (Probit) GMM estimator
ts_c <- sbinaryGMM(CRIMED ~ INC + HOVAL,
link = "probit",
listw = spdep::nb2listw(COL.nb, style = "W"),
data = COL.OLD,
type = "twostep",
verbose = TRUE,
cons.opt = TRUE)
summary(ts_c)
# }
Run the code above in your browser using DataLab