hetprob function

Estimate heteroskedastic binary (Probit or Logit) model.

Estimate heteroskedastic binary (Probit or Logit) model.

Estimation of binary dependent variables, either probit or logit, with heteroskedastic error terms for cross-sectional dataset.

hetprob(formula, data, link = c("probit", "logit"), ...) ## S3 method for class 'hetprob' terms(x, ...) ## S3 method for class 'hetprob' model.matrix(object, ...) ## S3 method for class 'hetprob' estfun(x, ...) ## S3 method for class 'hetprob' bread(x, ...) ## S3 method for class 'hetprob' vcov(object, eigentol = 1e-12, ...) ## S3 method for class 'hetprob' df.residual(object, ...) ## S3 method for class 'hetprob' coef(object, ...) ## S3 method for class 'hetprob' logLik(object, ...) ## S3 method for class 'hetprob' print(x, ...) ## S3 method for class 'hetprob' summary(object, eigentol = 1e-12, ...) ## S3 method for class 'summary.hetprob' print(x, digits = max(3, getOption("digits") - 2), ...) ## S3 method for class 'hetprob' predict(object, newdata = NULL, type = c("xb", "pr", "sigma"), ...)

Arguments

  • formula: a symbolic description of the model of the form y ~ x | z where y is the binary dependent variable and x and z are regressors variables for the mean of the model and lnsigma.
  • data: the data of class data.frame.
  • link: the assumption of the distribution of the error term. It could be either link = "probit" or link = "logit".
  • ...: arguments passed to maxLik.
  • x, object: an object of class hetprob.
  • eigentol: the standard errors are only calculated if the ratio of the smallest and largest eigenvalue of the Hessian matrix is less than eigentol. Otherwise the Hessian is treated as singular.
  • digits: the number of digits.
  • newdata: optionally, a data frame in which to look for variables with which to predict.
  • type: the type of prediction required. The default, type = xb, is on the linear prediction without the variance. If type = pr, the predicted probabilities of a positive outcome is returned. Finally, if type = sigma the predictions of σ\sigma for each individual is returned.

Returns

An object of class ```hetprob`'', a list elements: - logLik0: logLik for the homokedastic model,

  • f1: the formula,

  • mf: the model framed used,

  • call: the matched call.

Details

The heterokedastic binary model for cross-sectional data has the following structure:

yi=xiβ+ϵi, y_i^* = x_i^\top\beta + \epsilon_i,

with

var(ϵixi,zi)=σi2=[exp(ziδ)]2, var(\epsilon_i|x_i, z_i) = \sigma_i^2 = \left[\exp\left(z_i^\top\delta\right)\right]^2,

where yiy_i^* is the latent (unobserved) dependent variable for individual i=1,...,Ni = 1,...,N; xix_i is a K×1K\times 1 vector of independent variables determining the latent variable yiy_i^* (x variables in formula); and ϵi\epsilon_i is the error term distributed either normally or logistically with E(ϵizi,xi)=0E(\epsilon_i|z_i, x_i) = 0

and heterokedastic variance var(ϵixi,zi)=σi2,i=1,...,Nvar(\epsilon_i|x_i, z_i) = \sigma_i^2, \forall i = 1,...,N. The variance for each individual is modeled parametrically assuming that it depends on a P×1P\times 1

vector observed variables ziz_i (z in formula), whereas δ\delta is the vector of parameters associated with each variable. It is important to emphasize that ziz_i does not include a constant, otherwise the parameters are not identified.

The models are estimated using the maxLik function from maxLik package using both analytic gradient and hessian (if Hess = TRUE). In particular, the log-likelihood function is:

logL(θ)=inlog{[1F(xiβexp(ziδ))]1yi[F(xiβexp(ziδ))]yi}. \log L(\theta) = \sum_i^n\log \left\lbrace \left[1- F\left(\frac{x_i^\top\beta}{\exp(z_i^\top\delta)}\right)\right]^{1-y_i}\left[F\left(\frac{x_i^\top\beta}{\exp(z_i^\top\delta)}\right)\right]^{y_i}\right\rbrace.

Examples

# Estimate a heteroskedastic probit and logit model data("Health") het.probit <- hetprob(working ~ factor(female) + factor(year) + educ + age + I(age^2) | factor(female) + age + I(age^2), data = Health, link = "probit") summary(het.probit) het.logit <- hetprob(working ~ factor(female) + factor(year) + educ + age + I(age^2) | factor(female) + age + I(age^2), data = Health, link = "logit") summary(het.logit)

References

Greene, W. H. (2012). Econometric Analysis. 7 edition. Prentice Hall.

Author(s)

Mauricio Sarrias.

  • Maintainer: Mauricio Sarrias
  • License: GPL (>= 2)
  • Last published: 2023-03-10