Fits the Heckman Sample Selection Model based on the Birnbaum-Saunders (BS) bivariate distribution. This function implements the maximum likelihood estimation of the model parameters.
Usage
HeckmanBS(selection, outcome, data = sys.frame(sys.parent()), start = NULL)
Value
A list containing:
coefficients
: A named numeric vector of estimated model parameters.value
: The value of the likelihood function at the optimum.loglik
: The (negative) maximum log-likelihood.counts
: Number of gradient evaluations performed.hessian
: The Hessian matrix at the optimum.fisher_infoBS
: The (approximate) Fisher information matrix.prop_sigmaBS
: Approximate standard errors (square root of the Fisher information diagonal).level
: Levels of the selection variable.nObs
: Number of observations in the dataset.nParam
: Number of parameters estimated.N0
: Number of observations where the selection variable is zero.N1
: Number of observations where the selection variable is one.NXS
: Number of parameters in the selection equation.NXO
: Number of parameters in the outcome equation.df
: Degrees of freedom (observations minus number of parameters).aic
: Akaike Information Criterion.bic
: Bayesian Information Criterion.initial.value
: Initial values used in the optimization.
Details
The function estimates the parameters of the Heckman-BS model, which extends the classical Heckman model
by assuming that the error terms follow a bivariate Birnbaum-Saunders distribution.
The model has the same number of parameters as the classical Heckman model, including the correlation coefficient
between the error terms. The optimization is performed using the optim
function with the BFGS method.
The estimated quantities include:
Coefficients of the selection equation.
Coefficients of the outcome equation.
Estimated
sigma
(scale parameter of the outcome equation's error term).Estimated
rho
(correlation coefficient between the error terms).
Additional outputs include measures of model fit, standard errors (approximated by the square root of the diagonal of the inverse Fisher information matrix), and diagnostic information.
Examples
data(MEPS2001)
attach(MEPS2001)
#> The following objects are masked from MEPS2001 (pos = 3):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
selectEq <- dambexp ~ age + female + educ + blhisp + totchr + ins + income
outcomeBS <- ambexp ~ age + female + educ + blhisp + totchr + ins
HeckmanBS(selectEq, outcomeBS, data = MEPS2001)
#> Start not provided using default start values.
#> $coefficients
#> (Intercept) age female educ blhisp totchr
#> 0.117126176 0.089528907 0.721893635 0.068322795 -0.398979158 0.805603176
#> ins income (Intercept) age female educ
#> 0.179313173 0.003424215 5.778625015 0.246171408 0.410567060 -0.006632196
#> blhisp totchr ins sigma rho
#> -0.215177445 0.588729014 -0.061373289 0.702817425 0.273068245
#>
#> $value
#> [1] -24470.39
#>
#> $loglik
#> [1] -24470.39
#>
#> $counts
#> gradient
#> 91
#>
#> $hessian
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] -895.009884 -3.550012e+03 -408.999549 -1.183486e+04 -300.718621
#> [2,] -3550.011565 -1.520524e+04 -1646.323805 -4.692721e+04 -1134.499490
#> [3,] -408.999549 -1.646324e+03 -408.999549 -5.447084e+03 -142.565657
#> [4,] -11834.858781 -4.692721e+04 -5447.084329 -1.623152e+05 -3715.857459
#> [5,] -300.718621 -1.134499e+03 -142.565657 -3.715857e+03 -300.718621
#> [6,] -234.111776 -9.873598e+02 -106.635438 -2.993922e+03 -75.816946
#> [7,] -317.585411 -1.350865e+03 -131.136107 -4.262440e+03 -88.156945
#> [8,] -31728.648525 -1.301848e+05 -12713.578833 -4.410981e+05 -8859.892060
#> [9,] 145.924642 5.747815e+02 65.178656 1.934746e+03 48.986520
#> [10,] 574.781763 2.440942e+03 251.551154 7.614507e+03 186.552689
#> [11,] 65.178656 2.515510e+02 65.178656 8.555283e+02 25.736540
#> [12,] 1934.756213 7.614543e+03 855.532205 2.664384e+04 611.162586
#> [13,] 48.986520 1.865526e+02 25.736540 6.111596e+02 48.986520
#> [14,] 35.498435 1.484328e+02 12.584880 4.477695e+02 13.898926
#> [15,] 50.738741 2.096702e+02 19.674590 6.877397e+02 16.122884
#> [16,] 131.443684 5.192263e+02 62.246427 1.737628e+03 42.807710
#> [17,] 5.113677 1.716742e+00 -3.824942 -2.799141e+00 8.905821
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] -234.111776 -317.585411 -31728.6485 145.92464 574.7818
#> [2,] -987.359839 -1350.865208 -130184.8492 574.78149 2440.9424
#> [3,] -106.635438 -131.136107 -12713.5788 65.17866 251.5512
#> [4,] -2993.921687 -4262.439921 -441098.0691 1934.74613 7614.5074
#> [5,] -75.816946 -88.156945 -8859.8921 48.98652 186.5527
#> [6,] -285.789742 -65.989379 -7655.1211 35.49844 148.4327
#> [7,] -65.989379 -317.585411 -13078.1844 50.73874 209.6703
#> [8,] -7655.121129 -13078.184395 -1738739.9843 5274.47436 21634.1102
#> [9,] 35.498438 50.738741 5274.4744 -1887.69704 -7561.0060
#> [10,] 148.432731 209.670302 21634.1102 -7561.00604 -32512.6255
#> [11,] 12.584883 19.674590 1934.8759 -976.38929 -3804.9517
#> [12,] 447.767213 687.743499 73922.8274 -25852.59167 -103646.3745
#> [13,] 13.898927 16.122884 1432.0469 -528.70823 -2042.1809
#> [14,] 42.543843 10.926733 1198.5468 -846.89427 -3686.4378
#> [15,] 10.926734 50.738741 2212.4683 -652.90607 -2704.9276
#> [16,] 35.861194 43.436473 4910.8799 -1263.95022 -5075.3757
#> [17,] -7.414801 -9.134665 218.0628 -260.28605 -986.3899
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] 65.17866 1934.7562 48.98652 35.49844 50.73874
#> [2,] 251.55105 7614.5427 186.55260 148.43279 209.67019
#> [3,] 65.17866 855.5322 25.73654 12.58488 19.67459
#> [4,] 855.52828 26643.8418 611.15959 447.76953 687.73971
#> [5,] 25.73654 611.1626 48.98652 13.89893 16.12288
#> [6,] 12.58488 447.7672 13.89893 42.54384 10.92673
#> [7,] 19.67459 687.7435 16.12288 10.92673 50.73874
#> [8,] 1934.87593 73922.8274 1432.04691 1198.54682 2212.46829
#> [9,] -976.38929 -25852.5917 -528.70823 -846.89427 -652.90607
#> [10,] -3804.95173 -103646.3745 -2042.18095 -3686.43776 -2704.92756
#> [11,] -976.38929 -13339.5378 -318.85109 -442.87054 -302.77836
#> [12,] -13339.53779 -365136.8394 -6961.77813 -11475.46978 -9231.40156
#> [13,] -318.85109 -6961.7781 -528.70823 -245.24605 -171.67863
#> [14,] -442.87054 -11475.4698 -245.24605 -1357.39475 -255.25468
#> [15,] -302.77836 -9231.4016 -171.67863 -255.25468 -652.90607
#> [16,] -665.72413 -17243.2391 -353.04104 -585.15576 -423.78847
#> [17,] -98.65265 -3395.7003 -98.49486 -38.77638 -82.77576
#> [,16] [,17]
#> [1,] 131.44368 5.113677
#> [2,] 519.22626 1.716742
#> [3,] 62.24643 -3.824942
#> [4,] 1737.62795 -2.799141
#> [5,] 42.80771 8.905821
#> [6,] 35.86119 -7.414801
#> [7,] 43.43647 -9.134665
#> [8,] 4910.87987 218.062758
#> [9,] -1263.95022 -260.286051
#> [10,] -5075.37570 -986.389880
#> [11,] -665.72413 -98.652650
#> [12,] -17243.23915 -3395.700344
#> [13,] -353.04104 -98.494864
#> [14,] -585.15576 -38.776384
#> [15,] -423.78847 -82.775760
#> [16,] -3647.80131 -363.693684
#> [17,] -363.69368 -130.466699
#>
#> $fisher_infoBS
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 5.534926e-02 -4.023352e-03 -6.864132e-04 -2.808765e-03 -6.077958e-03
#> [2,] -4.023352e-03 9.967468e-04 -2.052831e-04 4.298991e-05 2.404204e-04
#> [3,] -6.864132e-04 -2.052831e-04 4.766100e-03 -1.044304e-04 -1.306809e-04
#> [4,] -2.808765e-03 4.298991e-05 -1.044304e-04 2.157718e-04 2.266968e-04
#> [5,] -6.077958e-03 2.404204e-04 -1.306809e-04 2.266968e-04 5.527934e-03
#> [6,] -1.426000e-03 -2.868359e-04 8.322966e-05 7.287852e-05 1.468244e-04
#> [7,] -3.740608e-04 -4.005195e-04 2.960627e-04 8.680324e-06 2.772719e-04
#> [8,] 4.777251e-05 -7.479738e-06 1.752878e-05 -7.386793e-06 5.418551e-06
#> [9,] 3.364262e-03 -2.446267e-04 -3.445002e-05 -1.436298e-04 -4.456176e-04
#> [10,] -2.534632e-04 7.588225e-05 -3.524420e-06 -3.377514e-06 2.098367e-05
#> [11,] 1.400008e-04 -1.259212e-05 3.376301e-04 -2.230163e-05 -5.046027e-06
#> [12,] -1.862532e-04 -1.577365e-06 -8.238448e-06 1.378892e-05 1.549357e-05
#> [13,] -5.889995e-04 2.782519e-05 4.640338e-07 2.752730e-05 4.480706e-04
#> [14,] 2.115490e-04 -3.506897e-05 -2.827026e-05 -1.373897e-05 1.567161e-05
#> [15,] 8.042176e-05 -3.177650e-05 2.576821e-05 -1.102744e-05 2.796917e-05
#> [16,] -1.686652e-04 8.641383e-06 1.697994e-05 1.220499e-05 -1.054191e-05
#> [17,] 2.716288e-03 -1.408322e-04 -1.733065e-04 -1.863814e-04 1.221995e-04
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] -1.426000e-03 -3.740608e-04 4.777251e-05 3.364262e-03 -2.534632e-04
#> [2,] -2.868359e-04 -4.005195e-04 -7.479738e-06 -2.446267e-04 7.588225e-05
#> [3,] 8.322966e-05 2.960627e-04 1.752878e-05 -3.445002e-05 -3.524420e-06
#> [4,] 7.287852e-05 8.680324e-06 -7.386793e-06 -1.436298e-04 -3.377514e-06
#> [5,] 1.468244e-04 2.772719e-04 5.418551e-06 -4.456176e-04 2.098367e-05
#> [6,] 4.652320e-03 5.117442e-04 3.428912e-06 2.265050e-04 -3.464038e-05
#> [7,] 5.117442e-04 5.343976e-03 -1.105323e-05 3.662084e-04 -4.266037e-05
#> [8,] 3.428912e-06 -1.105323e-05 2.045764e-06 -4.836152e-06 2.636505e-07
#> [9,] 2.265050e-04 3.662084e-04 -4.836152e-06 2.981018e-02 -2.000531e-03
#> [10,] -3.464038e-05 -4.266037e-05 2.636505e-07 -2.000531e-03 4.903062e-04
#> [11,] -8.116291e-05 -4.769792e-05 8.040463e-07 -1.962548e-03 1.156402e-04
#> [12,] -6.691075e-06 -1.787170e-05 1.509578e-07 -1.381669e-03 2.312515e-06
#> [13,] 6.045397e-05 8.081019e-05 -8.903285e-07 -1.485707e-03 6.921204e-05
#> [14,] 1.269581e-04 -3.025650e-05 8.018626e-07 -5.000035e-04 -1.331624e-04
#> [15,] 3.271856e-05 3.959916e-04 4.971521e-07 2.184725e-04 -1.029810e-04
#> [16,] 3.986348e-05 5.040070e-05 -5.460869e-07 1.721848e-04 -1.847846e-05
#> [17,] -5.178742e-04 -7.821903e-04 1.054548e-05 -6.194990e-03 2.388018e-04
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] 1.400008e-04 -1.862532e-04 -5.889995e-04 2.115490e-04 8.042176e-05
#> [2,] -1.259212e-05 -1.577365e-06 2.782519e-05 -3.506897e-05 -3.177650e-05
#> [3,] 3.376301e-04 -8.238448e-06 4.640338e-07 -2.827026e-05 2.576821e-05
#> [4,] -2.230163e-05 1.378892e-05 2.752730e-05 -1.373897e-05 -1.102744e-05
#> [5,] -5.046027e-06 1.549357e-05 4.480706e-04 1.567161e-05 2.796917e-05
#> [6,] -8.116291e-05 -6.691075e-06 6.045397e-05 1.269581e-04 3.271856e-05
#> [7,] -4.769792e-05 -1.787170e-05 8.081019e-05 -3.025650e-05 3.959916e-04
#> [8,] 8.040463e-07 1.509578e-07 -8.903285e-07 8.018626e-07 4.971521e-07
#> [9,] -1.962548e-03 -1.381669e-03 -1.485707e-03 -5.000035e-04 2.184725e-04
#> [10,] 1.156402e-04 2.312515e-06 6.921204e-05 -1.331624e-04 -1.029810e-04
#> [11,] 2.326648e-03 1.259946e-05 -3.308081e-04 7.376229e-05 1.690598e-04
#> [12,] 1.259946e-05 9.780675e-05 5.425888e-05 2.499726e-05 -5.986491e-05
#> [13,] -3.308081e-04 5.425888e-05 2.827185e-03 -1.175148e-04 -2.365084e-05
#> [14,] 7.376229e-05 2.499726e-05 -1.175148e-04 1.176385e-03 1.322124e-04
#> [15,] 1.690598e-04 -5.986491e-05 -2.365084e-05 1.322124e-04 2.461093e-03
#> [16,] -1.025723e-04 -1.199852e-05 7.270793e-05 -8.820452e-05 -2.812867e-06
#> [17,] 1.365177e-03 2.024267e-04 -1.011739e-03 1.205255e-03 1.733222e-04
#> [,16] [,17]
#> [1,] -1.686652e-04 2.716288e-03
#> [2,] 8.641383e-06 -1.408322e-04
#> [3,] 1.697994e-05 -1.733065e-04
#> [4,] 1.220499e-05 -1.863814e-04
#> [5,] -1.054191e-05 1.221995e-04
#> [6,] 3.986348e-05 -5.178742e-04
#> [7,] 5.040070e-05 -7.821903e-04
#> [8,] -5.460869e-07 1.054548e-05
#> [9,] 1.721848e-04 -6.194990e-03
#> [10,] -1.847846e-05 2.388018e-04
#> [11,] -1.025723e-04 1.365177e-03
#> [12,] -1.199852e-05 2.024267e-04
#> [13,] 7.270793e-05 -1.011739e-03
#> [14,] -8.820452e-05 1.205255e-03
#> [15,] -2.812867e-06 1.733222e-04
#> [16,] 4.293894e-04 -1.052515e-03
#> [17,] -1.052515e-03 1.537118e-02
#>
#> $prop_sigmaBS
#> [1] 0.235264236 0.031571297 0.069036945 0.014689173 0.074350075 0.068207921
#> [7] 0.073102502 0.001430302 0.172656248 0.022142860 0.048235341 0.009889729
#> [13] 0.053171276 0.034298468 0.049609405 0.020721712 0.114735777
#>
#> $level
#> [1] "0" "1"
#>
#> $nObs
#> [1] 3328
#>
#> $nParam
#> [1] 17
#>
#> $N0
#> [1] 526
#>
#> $N1
#> [1] 2802
#>
#> $NXS
#> [1] 8
#>
#> $NXO
#> [1] 7
#>
#> $df
#> [1] 3311
#>
#> $aic
#> [1] 48974.79
#>
#> $bic
#> [1] 49078.66
#>
#> $initial.value
#> [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
#>
#> attr(,"class")
#> [1] "HeckmanBS"