heckprobit: probit model with sample selection
Output : bundle
Arguments: series depvar,
list indepvars_maineq,
series selvar,
list indepvars_seleq,
scalar vcv (optional),
scalar ver (optional),
scalar new (optional)
scalar vcv: 0 Hessian (default), 1 Asymptotic, 2 Sandwich
scalar ver: 0 No output, 1 Output from function (default), 2 Verbose MLE
scalar new: 1 Newton-Raphson (default), 0 BFGS
Estimates a probit model with sample selection (Van de Ven and Van
Pragg, 1981).
The argument list starts with the dependent variables of the main
equation (depvar), followed by the list of regressors
(indepvars_maineq), then the dependent variable of the selection
equation (selvar) needs to be supplied, followed by its on list of
regressors (indepvars_seleq).
By default, standard errors are computed using a numerical
approximation to the Hessian at convergence, the printed estimation
output is provided by the public function heckprobit_printout, and the
log-likelihood is maximized by Newton-Raphson. Default settings can be
changed by including the optional scalars as function arguments.
Examples:
- Default settings
b = heckprobit(y,X,s,Z)
- Robust standard errors, verbose mle, optimizer bfgs
b = heckprobit(y,X,s,Z,2,2,0)
Alternatively to the wrapper function heckprobit, the public functions
heckprobit_setup, heckprobit_setoption, heckprobit_estimate, and
heckprobit_printout can be used
Examples:
- Default settings
b = heckprobit_setup(y,X,s,Z)
heckprobit_estimate(&b)
heckprobit_printout(&b)
If desired, the user can supply a pointer to a vector of initial
values for the estimation as an additional argument to
heckprobit_estimate, for example:
par = muniform(nelem(X)+nelem(Z)+1,1)
b = heckprobit_estimate(&b, &par)
- Robust standard errors, verbose mle, optimizer bfgs
b = heckprobit_setup(y,X,s,Z)
foo = heckprobit_setoption(&b, "vcvtype", 2)
moo = heckprobit_setoption(&b, "verbose", 2)
bar = heckprobit_setoption(&b, "newton" , 0)
heckprobit_estimate(&b)
heckprobit_printout(&b)
When using public functions, options have to be supplied via
heckprobit_setoption
Output : scalar
Arguments : *bundle b, string opt, scalar value
The function returns a scalar equal to 0 if the option has been
successfully set. Otherwise an integer is returned and the associated
warning is printed. The string identifies the option for the type of
estimated covariance matrix to be computed, verbosity level, and
optimizer. The associated scalars are described above, vcv, ver and
new, respectively.
Van de Ven, W. P. M. M., and B. M. S. Van Pragg, (1981): "The demand
for deductibles in private health insurance: A probit model with
sample selection" Journal of Econometrics 17: 229–252
========================================================================
CHANGELOG:
0.1 -> 0.2: No user-visible changes. Internal changes: fixed a bug with
initialisation (abs(rho) could be >1); use more modern syntax when
handling bundle elements.