R: Semiparametric Sample Selection Modelling with Continuous or...
SemiParSampleSel
R Documentation
Semiparametric Sample Selection Modelling with Continuous or Discrete Response
Description
SemiParSampleSel can be used to fit continuous or discrete response sample selection models where the linear predictors
are flexibly specified using parametric and
regression spline components. The depedence between the selection and outcome equations is modelled through the use of copulas. Regression
spline bases are extracted from the package mgcv. Multi-dimensional smooths are available
via the use of penalized thin plate regression splines. If it makes sense, the dependence parameter of
the chosen bivariate distribution as well as the shape and dispersion parameters of the outcome distribution can be specified as
functions of semiparametric predictors.
A list of two formulas, one for selection equation and the other for the outcome equation. s terms
are used to specify smooth smooth functions of
predictors. SemiParSampleSel supports the use shrinkage smoothers for variable
selection purposes. See the examples below and the documentation of mgcv for further
details on formula specifications. Note that the first formula MUST refer to the selection equation.
Furthermore,
if it makes sense, more equations can be specified for the other model parameters (see Example 1 below).
data
An optional data frame, list or environment containing the variables in the model. If not found in data, the
variables are taken from environment(formula), typically the environment from which SemiParSampleSel is called.
weights
Optional vector of prior weights to be used in fitting.
subset
Optional vector specifying a subset of observations to be used in the fitting process.
start.v
Starting values for all model parameters can be provided here. Otherwise, these are obtained using an
adaptation of the two-stage Heckman sample selection correction approach.
start.theta
A starting value for the association parameter of the copula given in BivD.
BivD
Type of bivariate error distribution employed. Possible choices are "N", "C0", "C90", "C180", "C270", "J0", "J90", "J180", "J270",
"G0", "G90", "G180", "G270", "F", "FGM" and "AMH" which stand for bivariate normal, Clayton, rotated Clayton (90 degrees),
survival Clayton,
rotated Clayton (270 degrees), Joe, rotated Joe (90 degrees), survival Joe, rotated Joe (270 degrees),
Gumbel, rotated Gumbel (90 degrees), survival Gumbel, rotated Gumbel (270 degrees), Frank,
Farlie-Gumbel-Morgenstern, and Ali-Mikhail-Haq.
margins
A two-dimensional vector which specifies the marginal distributions of the selection and outcome
equations. The first margin currently admits only "probit" or equivalently "N".
The second margin can be "N", "GA", "P", "NB", "D", "PIG", "S", "BB", "BI", "GEOM", "LG",
"NBII", "WARING", "YULE", "ZIBB", "ZABB", "ZABI", "ZIBI", "ZALG", "ZANBI", "ZINBI", "ZAP",
"ZIP", "ZIP2", "ZIPIG" which stand for normal, gamma, Poisson, negative binomial type I, Delaporte,
Poisson inverse Gaussian, Sichel, beta binomial, binomial, geometric, logarithmic, negative binomial
type II, Waring, Yule, zero inflated beta binomial, zero altered beta binomial, zero altered binomial,
zero inflated binomial, zero altered logarithmic, zero altered negative binomial type I, zero inflated
negative binomial type I, zero altered Poisson, zero inflated Poisson, zero inflated Poisson type II
and zero inflated Poisson inverse Gaussian.
fp
If TRUE, then a fully parametric model with regression splines if fitted.
infl.fac
Inflation factor for the model degrees of freedom in the UBRE score. Smoother models can be obtained setting
this parameter to a value greater than 1.
rinit
Starting trust region radius. The trust region radius is adjusted as the algorithm proceeds. See the documentation
of trust for further details.
rmax
Maximum allowed trust region radius. This may be set very large. If set small, the algorithm traces a steepest
descent path.
iterlimsp
A positive integer specifying the maximum number of loops to be performed before the smoothing parameter estimation step
is terminated.
pr.tolsp
Tolerance to use in judging convergence of the algorithm when automatic smoothing parameter estimation is used.
bd
Binomial denominator. To be used in the case of "BB", "BI", "ZIBB", "ZABB", "ZABI", "ZIBI".
parscale
The algorithm will operate as if optimizing objfun(x / parscale, ...). If missing then no rescaling is done. See the
documentation of trust for more details.
Details
The association between the responses is modelled by parameter ρ or θ. In a semiparametric
bivariate sample selection model
the linear predictors are flexibly specified using
parametric components and smooth functions of covariates. Replacing the smooth components with their regression spline expressions yields a
fully parametric bivariate sample selection model. In principle, classic
maximum likelihood estimation can be employed. However, to avoid overfitting, penalized likelihood maximization is used instead. Here the use of
penalty matrices allows for the suppression of that part of smooth term complexity which has no support from the data. The tradeoff
between smoothness
and fitness is controlled by smoothing parameters associated with the penalty matrices. Smoothing parameters are chosen to
minimize the approximate Un-Biased Risk Estimator (UBRE) score, which can also be viewed as an approximate AIC.
The optimization problem is solved by a trust region algorithm. Automatic smoothing parameter selection is integrated
using a performance-oriented iteration approach (Gu, 1992; Wood, 2004). Roughly
speaking, at each iteration, (i) the penalized weighted least squares
problem is solved, and (ii) the smoothing parameters of that problem estimated by approximate UBRE. Steps (i) and (ii) are
iterated until convergence. Details of the underlying fitting methods are given in Marra and Radice (2013) and Wojtys et. al (in press).
Value
The function returns an object of class SemiParSampleSel as described in SemiParSampleSelObject.
WARNINGS
Convergence failure may occur when ρ or θ is very high, and/or the total number and selected number of
observations are low, and/or there are important mistakes in the model specification (i.e., using C90 when the model equations
are positively associated), and/or there are many smooth components in the model as compared to the number of observations. Convergence
failure may also mean that an infinite cycling between steps (i) and (ii) occurs. In this case, the smoothing parameters are set to the values
obtained from the non-converged algorithm (conv.check will give a warning). In such cases, we
recommend re-specifying the model, and/or using some rescaling (see parscale).
In the context of non-random sample selection, it would not make much sense to specify the dependence
parameter as function of covariates. This is because the assumption is that
the dependence parameter models the
association between the unobserved confounders in the two equations. However, this option does make sense when it is believed that the
association coefficient varies across geographical areas, for instance.
Gu C. (1992), Cross validating non-Gaussian data. Journal of Computational and Graphical Statistics, 1(2), 169-179.
Marra G. and Radice R. (2013), Estimation of a Regression Spline Sample Selection Model. Computational Statistics and Data Analysis, 61, 158-173.
Wojtys M., Marra G. and Radice R. (in press), Copula Regression Spline Sample Selection Models: The R Package SemiParSampleSel. Journal of Statistical Software.
Wood S.N. (2004), Stable and efficient multiple smoothing parameter estimation for generalized additive models. Journal of the American Statistical Association, 99(467), 673-686.