Learn R Programming

micsr (version 0.1-1)

escount: 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")
)

Value

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

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

Author

Yves Croissant

References

TERZ:98micsr

GREE:01micsr

Examples

Run this code
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")

Run the code above in your browser using DataLab