escount: Endogenous switching and sample selection models for count...

View source: R/escount.R

escountR Documentation

Endogenous switching and sample selection models for count data

Description

Heckman's like estimator for count data, using either maximum likelihood or a two-steps estimator

Usage

escount(
  formula,
  data,
  subset,
  weights,
  na.action,
  offset,
  start = NULL,
  R = 16,
  hessian = FALSE,
  method = c("twosteps", "ml"),
  model = c("es", "ss")
)

Arguments

formula

a Formula object which includes two responses (the count and the binomial variables) and two sets of covariates (for the count component and for the selection equation)

data

a data frame,

subset, weights, na.action, offset

see stats::lm

start

an optional vector of starting values,

R

the number of points for the Gauss-Hermite quadrature

hessian

if TRUE, the numerical hessian is computed, otherwise the covariance matrix of the coefficients is computed using the outer product of the gradient

method

one of 'ML' for maximum likelihood estimation (the default) or 'twosteps' for the two-steps NLS method

model

one of 'es' for endogenous switching (the default) or 'ss' for sample selection

Value

an object of class ⁠c("escount,micsr)"⁠, see micsr::micsr for further details.

Author(s)

Yves Croissant

References

\insertRef

TERZ:98micsr

\insertRef

GREE:01micsr

Examples

trips_2s <- escount(trips | car ~ workschl + size + dist + smsa + fulltime + distnod +
realinc + weekend + car | . - car - weekend + adults, data = trips, method = "twosteps")
trips_ml <- update(trips_2s, method = "ml")

micsr documentation built on May 29, 2024, 7:32 a.m.