Learn R Programming

Rchoice (version 0.3-6)

hetprob: Estimate heteroskedastic binary (Probit or Logit) model.

Description

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

Usage

hetprob(formula, data, link = c("probit", "logit"), ...)

# S3 method for hetprob terms(x, ...)

# S3 method for hetprob model.matrix(object, ...)

# S3 method for hetprob estfun(x, ...)

# S3 method for hetprob bread(x, ...)

# S3 method for hetprob vcov(object, eigentol = 1e-12, ...)

# S3 method for hetprob df.residual(object, ...)

# S3 method for hetprob coef(object, ...)

# S3 method for hetprob logLik(object, ...)

# S3 method for hetprob print(x, ...)

# S3 method for hetprob summary(object, eigentol = 1e-12, ...)

# S3 method for summary.hetprob print(x, digits = max(3, getOption("digits") - 2), ...)

# S3 method for hetprob predict(object, newdata = NULL, type = c("xb", "pr", "sigma"), ...)

Value

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.

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.

Author

Mauricio Sarrias.

Details

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

$$ y_i^* = x_i^\top\beta + \epsilon_i, $$ with $$ var(\epsilon_i|x_i, z_i) = \sigma_i^2 = \left[\exp\left(z_i^\top\delta\right)\right]^2, $$ where \(y_i^*\) is the latent (unobserved) dependent variable for individual \(i = 1,...,N\); \(x_i\) is a \(K\times 1\) vector of independent variables determining the latent variable \(y_i^*\) (x variables in formula); and \(\epsilon_i\) is the error term distributed either normally or logistically with \(E(\epsilon_i|z_i, x_i) = 0\) and heterokedastic variance \(var(\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\times 1\) vector observed variables \(z_i\) (z in formula), whereas \(\delta\) is the vector of parameters associated with each variable. It is important to emphasize that \(z_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:

$$\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.$$

References

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

Examples

Run this code
# \donttest{
# 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)
# }

Run the code above in your browser using DataLab