DiSSMod {DiSSMod} | R Documentation |
Fitting Sample Selection Models for Discrete Response Variables
Description
Function DiSSMod
fits sample selection models for discrete random
variables, by suitably extending the formulation of the classical
Heckman model to the case of a discrete response, but retaining the
original conceptual framework. Maximum likelihood estimates are obtained
by Newton-Raphson iteration combined with use of profile likelihood.
Usage
DiSSMod(response, selection, data, resp.dist, select.dist, alpha,
trunc.num, standard = FALSE, verbose = 1, eps = 1e-07,
itmax = 1000)
Arguments
response |
a formula for the response equation. |
selection |
a formula for the selection equation. |
data |
a data frame and data has to be included with the form of |
resp.dist |
a character for the distribution choice of the response variable,
|
select.dist |
a character for the distribution choice of the selection variable,
|
alpha |
a vector of |
trunc.num |
an integer numeric constant used as the truncation point of an infine summation of probabilities
involved when |
standard |
a logical value for the standardizing explanatory variables, if |
verbose |
an integer value for the level of printed details (values: 0|1|2); the default value is 1 which stands for shortly printed details. If the value is 2, more details are viewed such as values of the log likelihood functions and iteration numbers. If the value is 0, there is no printed detail. |
eps |
a numeric value for the estimating parameters, which is needed for the step of the optimization.
If the sum of absolute differences between present step estimated parameters and former step
estimated parameters is smaller than |
itmax |
an integer stands for maximum number for the iteration of optimizing the parameters. |
Details
The specification of the two linear models regulating the response variable and
the selection mechanism, as indicated in the ‘Background’ section,
is accomplished by two arguments of formula
type,
denoted response
and selection
, respectively.
Each formula
is specified with the same syntax of similar arguments in
standard functions such as lm
and glm
, with the restriction that
the intercept term (which is automatically included) must not be removed.
The distributional assumptions associated to the response
and selection
components
are specified by the arguments resp.dist
and select.dist
, respectively.
Argument select.dist
refers to the unobservable continuous variable of which we
observe only the dichotomous outcome Yes-No.
In this respect, a remark is appropriate about the option "Gumbel"
for select.dist
.
This choice is equivalent to the adoption of an Exponential distribution of the selection variables
combined an exponential transformation of the linear predictor of the
selection
argument, as it is presented in Section 3.2 of Azzalini et al. (2019).
Also, it corresponds to work with the log-transformation of an Exponential variable,
which is essentially a Gumbel type of variable, up to a linear transformation with
respect to its more commonly employed parameterization.
When resp.dist
is "Poisson"
or "NegBinomial"
and trunc.num
is missing,
a default choice is made; this equals 1.5*m
or 2*m
in the two respective cases,
where m
denotes the maximum observed value of the response variable.
Function DiSSMOd
calls lower level functions, nr.bin, nr.nbinom, nr.pois
and the others
for the actual numerical maximization of the log-likelihood via a Newton-Raphson iteration.
Notice that the automatic initialization of the alpha
search interval, when this argument is
missing, may change in future versions of the package.
Value
DiSSMod
returns an object of class "DiSSMod"
,
which is a list containing following components:
call |
a matched call. |
standard |
a logical value, stands for standardization or not. |
st_loglik |
a vector containing the differences between log likelihoods and maximized log likelihood. |
max_loglik |
a maximized log likelihood value. |
mle_alpha |
a maximized likelihood estimator of alpha. |
alpha |
a vector containing grids of the alpha |
Nalpha |
a vector containing proper alpha, which does not have
|
num_NA |
a number of |
n_select |
a number of selected response variables. |
n_all |
a number of all response variables. |
estimate_response |
estimated values for the response model. |
std_error_response |
estimated standard errors for the response model. |
estimate_selection |
estimated values for the selection model. |
std_error_selection |
estimated standard errors for the selection model. |
Background
Function DiSSMod
fits sample selection models for discrete random variables,
by suitably extending the formulation of the classical Heckman model to the case of a discrete response,
but retaining the original conceptual framework.
This logic involves the following key ingredients: (1) a linear model indicating which explanatory variables
influence the response variable; (2) a linear model indicating which (possibly different) explanatory variables,
besides the response variable itself, influence a ‘selection variable’, which is intrinsically continuous but
we only observe a dichotomous outcome from it, of type Yes-No, which selects which are the observed response cases;
(3) distributional assumptions on the response and the selection variable.
The data fitting method is maximum likelihood estimation (MLE), which operates in two steps:
(i) for each given value of parameter alpha
which regulates the level of selection,
MLE is performed for all the remaining parameters, using a Newton-Raphson iteration;
(ii) a scan of the alpha
axis builds the profile log-likelihood function and
its maximum point represents the overall MLE.
A detailed account of the underlying theory and the operational methodology is provided by Azzalini et al. (2019).
References
Azzalini, A., Kim, H.-M. and Kim, H.-J. (2019) Sample selection models for discrete and other non-Gaussian response variables. Statistical Methods & Applications, 28, 27–56. First online 30 March 2018. https://doi.org/10.1007/s10260-018-0427-1
See Also
The functions summary.DiSSMod
, coef.DiSSMod
,
confint.DiSSMod
, plot.DiSSMod
are used to obtain and print a summary, coefficients, confidence interval and
plot of the results.
The generic function logLik
is used to obtain maximum log likelihood of the
result.
Examples
set.seed(45)
data(DoctorRWM, package = "DiSSMod")
n0 <- 600
set.n0 <- sample(1:nrow(DoctorRWM), n0)
reduce_DoctorRWM <- DoctorRWM[set.n0,]
result0 <- DiSSMod(response = as.numeric(DOCVIS > 0) ~ AGE + INCOME_SCALE + HHKIDS + EDUC + MARRIED,
selection = PUBLIC ~ AGE + EDUC + FEMALE,
data = reduce_DoctorRWM, resp.dist="bernoulli", select.dist = "normal",
alpha = seq(-5.5, -0.5, length.out = 21), standard = TRUE)
print(result0)
data(CreditMDR, package = "DiSSMod")
n1 <- 600
set.n1 <- sample(1:nrow(CreditMDR), n1)
reduce_CreditMDR <- CreditMDR[set.n1,]
result1 <- DiSSMod(response = MAJORDRG ~ AGE + INCOME + EXP_INC,
selection = CARDHLDR ~ AGE + INCOME + OWNRENT + ADEPCNT + SELFEMPL,
data = reduce_CreditMDR, resp.dist="poi", select.dist = "logis",
alpha = seq(-0.3, 0.3,length.out = 21), standard = FALSE, verbose = 1)
print(result1)