hetprob | R Documentation |
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"), ...)
formula |
a symbolic description of the model of the form |
data |
the data of class |
link |
the assumption of the distribution of the error term. It could be either |
... |
arguments passed to |
x, object |
an object of class |
eigentol |
the standard errors are only calculated if the ratio of the smallest and largest eigenvalue of the Hessian matrix is less than |
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, |
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.
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. |
Mauricio Sarrias.
Greene, W. H. (2012). Econometric Analysis. 7 edition. Prentice Hall.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.