Estimates the parameters of the Generalized Heckman model
HeckmanGe(
selection,
outcome,
outcomeS,
outcomeC,
data = sys.frame(sys.parent()),
start = NULL
)
Selection equation.
Primary Regression Equation.
Matrix with Covariates for fit of the Dispersion Parameter.
Matrix with Covariates for fit of the Correlation Parameter.
Database.
initial values.
Returns a list with the following components.
Coefficients: Returns a numerical vector with the best estimated values of the model parameters;
Value: The value of function to be minimized (or maximized) corresponding to par.
loglik: Negative of value. Minimum (or maximum) of the likelihood function calculated from the estimated coefficients.
counts: Component of the Optim function. A two-element integer vector giving the number of calls to fn and gr respectively. This excludes those calls needed to compute the Hessian, if requested, and any calls to fn to compute a finite-difference approximation to the gradient.
hessian: Component of the Optim function, with pre-defined option hessian=TRUE. A symmetric matrix giving an estimate of the Hessian at the solution found. Note that this is the Hessian of the unconstrained problem even if the box constraints are active.
fisher_infoHG: Fisher information matrix
prop_sigmaHG: Square root of the Fisher information matrix diagonal
level: Selection variable levels
nObs: Numeric value representing the size of the database
nParam: Numerical value representing the number of model parameters
N0: Numerical value representing the number of unobserved entries
N1: Numerical value representing the number of complete entries
NXS: Numerical value representing the number of parameters of the selection model
NXO: Numerical value representing the number of parameters of the regression model
df: Numerical value that represents the difference between the size of the response vector of the selection equation and the number of model parameters
aic: Numerical value representing Akaike's information criterion.
bic: Numerical value representing Schwarz's Bayesian Criterion
initial.value: Numerical vector that represents the input values (Initial Values) used in the parameter estimation.
NE: Numerical value that represents the number of parameters related to the covariates fitted to the dispersion parameter considering the constant parameter.
NV: Numerical value that represents the number of parameters related to the covariates fitted to the correlation parameter considering the constant parameter.
The HeckmanGe() function fits a generalization of the Heckman sample selection model, allowing sample selection bias and dispersion parameters to depend on covariates. For more information, see Bastos et al. (2022)
Fernando de Souza Bastos, Wagner Barreto-Souza, Marc G Genton (2022). “A Generalized Heckman Model With Varying Sample Selection Bias and Dispersion Parameters.” Statistica Sinica.
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
#> The following objects are masked from MEPS2001 (pos = 4):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
#> The following objects are masked from MEPS2001 (pos = 5):
#>
#> 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
outcomeEq <- lnambx ~ age + female + educ + blhisp + totchr + ins
outcomeS <- cbind(age,female,totchr,ins)
outcomeC <- 1
HeckmanGe(selectEq, outcomeEq,outcomeS, outcomeC, data = MEPS2001)
#> $coefficients
#> (Intercept) age female educ blhisp
#> -0.5898951223 0.0938277503 0.6316215135 0.0551870780 -0.3299398157
#> totchr ins income (Intercept) age
#> 0.7220902788 0.1649678564 0.0023791995 5.8622174738 0.1721671972
#> female educ blhisp totchr ins
#> 0.1498487806 0.0009664351 -0.1346591903 0.4131454649 -0.1090664188
#> interceptS age female totchr ins
#> 0.6132211465 -0.0286317476 -0.1297362444 -0.1185326955 -0.1122382327
#> rho
#> -0.7423300084
#>
#> $value
#> [1] -5804.973
#>
#> $loglik
#> [1] 5804.973
#>
#> $counts
#> gradient
#> 68
#>
#> $hessian
#> (Intercept) age female educ blhisp
#> (Intercept) -1503.8320 -5768.7014 -548.07913 -19505.225 -598.71846
#> age -5768.7014 -24017.0001 -2063.43571 -74733.444 -2215.73389
#> female -548.0791 -2063.4357 -548.07913 -7155.366 -244.31154
#> educ -19505.2254 -74733.4440 -7155.36633 -263526.008 -7335.13297
#> blhisp -598.7185 -2215.7339 -244.31154 -7335.133 -598.71846
#> totchr -245.7401 -1022.7992 -87.52824 -3108.367 -93.92916
#> ins -503.9783 -2074.0129 -166.68301 -6631.956 -184.28534
#> income -50796.7910 -202912.7410 -16179.02293 -689147.952 -17652.25611
#> (Intercept) -561.6396 -2199.9850 -234.53702 -7347.265 -212.40637
#> age -2199.9826 -9336.7901 -884.92649 -28735.643 -806.15883
#> female -234.5370 -884.9280 -234.53702 -3060.170 -101.53903
#> educ -7347.1799 -28735.3212 -3060.11926 -100082.231 -2635.68456
#> blhisp -212.4064 -806.1593 -101.53903 -2635.700 -212.40637
#> totchr -116.5326 -493.4529 -43.83385 -1471.961 -44.45366
#> ins -207.4636 -856.9627 -79.88930 -2756.548 -74.98259
#> interceptS -341.6726 -1423.4933 -204.61840 -4652.111 -89.30248
#> age -1423.5041 -6350.7807 -783.35765 -19333.859 -369.77724
#> female -204.6184 -783.3527 -204.61840 -2743.927 -72.10447
#> totchr -125.1580 -537.2119 -58.27067 -1621.238 -39.21385
#> ins -142.4253 -607.9887 -77.03432 -1943.558 -34.33872
#> correlation -220.3325 -824.7950 -57.48613 -2642.319 -117.42624
#> totchr ins income (Intercept) age
#> (Intercept) -245.740147 -503.97832 -50796.791 -561.63959 -2199.9826
#> age -1022.799208 -2074.01288 -202912.741 -2199.98500 -9336.7901
#> female -87.528244 -166.68301 -16179.023 -234.53702 -884.9265
#> educ -3108.366836 -6631.95571 -689147.952 -7347.26516 -28735.6433
#> blhisp -93.929163 -184.28534 -17652.256 -212.40637 -806.1588
#> totchr -287.255409 -72.37816 -8053.978 -116.53264 -493.4516
#> ins -72.378157 -503.97832 -19383.170 -207.46364 -856.9617
#> income -8053.978134 -19383.17046 -2551773.876 -19340.47057 -79001.3188
#> (Intercept) -116.532642 -207.46364 -19340.471 -1840.21267 -7744.8226
#> age -493.451613 -856.96174 -79001.319 -7744.82255 -34881.3007
#> female -43.833854 -79.88930 -7113.603 -1091.74360 -4565.2778
#> educ -1471.919852 -2756.51305 -264136.471 -24837.04272 -104562.5191
#> blhisp -44.453664 -74.98259 -6429.909 -528.17075 -2122.5723
#> totchr -139.079865 -39.13085 -3905.381 -1248.85603 -5699.7907
#> ins -39.130853 -207.46364 -7981.753 -770.75982 -3326.3256
#> interceptS -125.157926 -142.42526 -12807.226 147.64051 510.4381
#> age -537.216452 -607.99305 -55388.255 510.43683 1715.4307
#> female -58.270644 -77.03432 -6578.168 11.14738 109.4030
#> totchr -154.693276 -40.02222 -4281.339 -20.81848 -147.6887
#> ins -40.022207 -142.42526 -5670.424 36.75497 123.2458
#> correlation 3.565878 -65.73108 -6352.245 -306.00557 -1171.0631
#> female educ blhisp totchr ins
#> (Intercept) -234.53702 -7347.17990 -212.40637 -116.53262 -207.46364
#> age -884.92795 -28735.32125 -806.15930 -493.45292 -856.96272
#> female -234.53702 -3060.11926 -101.53903 -43.83385 -79.88930
#> educ -3060.16956 -100082.23075 -2635.70003 -1471.96126 -2756.54800
#> blhisp -101.53903 -2635.68456 -212.40637 -44.45366 -74.98259
#> totchr -43.83385 -1471.91985 -44.45366 -139.07986 -39.13085
#> ins -79.88930 -2756.51305 -74.98259 -39.13085 -207.46364
#> income -7113.60260 -264136.47120 -6429.90911 -3905.38089 -7981.75281
#> (Intercept) -1091.74360 -24837.04272 -528.17075 -1248.85603 -770.75982
#> age -4565.27779 -104562.51915 -2122.57227 -5699.79071 -3326.32565
#> female -1091.74360 -14729.79645 -328.50040 -826.24713 -426.50900
#> educ -14729.79645 -347169.01664 -6689.65951 -16793.90086 -10509.20435
#> blhisp -328.50040 -6689.65951 -528.17075 -324.92494 -199.49090
#> totchr -826.24713 -16793.90086 -324.92494 -2450.10390 -478.46063
#> ins -426.50900 -10509.20435 -199.49090 -478.46063 -770.75982
#> interceptS 11.14738 1771.85259 87.46862 -20.81846 36.75497
#> age 109.40146 6050.45021 343.51800 -147.69455 123.24457
#> female 11.14738 -76.20197 51.11117 -55.74008 -27.73104
#> totchr -55.73993 -576.62026 66.00211 -16.27606 12.36679
#> ins -27.73104 465.33834 21.34998 12.36676 36.75497
#> correlation -104.74183 -3842.03504 -140.11925 -28.69377 -105.18103
#> interceptS age female totchr ins
#> (Intercept) -341.67255 -1423.5041 -204.61840 -125.15799 -142.42526
#> age -1423.49334 -6350.7807 -783.35272 -537.21186 -607.98872
#> female -204.61840 -783.3576 -204.61840 -58.27067 -77.03432
#> educ -4652.11052 -19333.8589 -2743.92733 -1621.23786 -1943.55791
#> blhisp -89.30248 -369.7772 -72.10447 -39.21385 -34.33872
#> totchr -125.15793 -537.2165 -58.27064 -154.69328 -40.02221
#> ins -142.42526 -607.9930 -77.03432 -40.02222 -142.42526
#> income -12807.22638 -55388.2546 -6578.16808 -4281.33885 -5670.42445
#> (Intercept) 147.64051 510.4368 11.14738 -20.81848 36.75497
#> age 510.43814 1715.4307 109.40300 -147.68872 123.24580
#> female 11.14738 109.4015 11.14738 -55.73993 -27.73104
#> educ 1771.85259 6050.4502 -76.20197 -576.62026 465.33834
#> blhisp 87.46862 343.5180 51.11117 66.00211 21.34998
#> totchr -20.81846 -147.6946 -55.74008 -16.27606 12.36676
#> ins 36.75497 123.2446 -27.73104 12.36679 36.75497
#> interceptS -5750.05674 -23676.8262 -3175.53771 -3180.92766 -2165.45044
#> age -23676.82617 -104444.7044 -12867.97977 -14114.68825 -9235.30535
#> female -3175.53771 -12867.9798 -3175.53771 -1811.26619 -1103.03257
#> totchr -3180.92766 -14114.6883 -1811.26619 -5433.07695 -1098.86379
#> ins -2165.45044 -9235.3054 -1103.03257 -1098.86379 -2165.45044
#> correlation -663.76350 -2555.0888 -272.47774 -97.65758 -234.30985
#> correlation
#> (Intercept) -220.332491
#> age -824.795016
#> female -57.486130
#> educ -2642.319046
#> blhisp -117.426238
#> totchr 3.565878
#> ins -65.731081
#> income -6352.244654
#> (Intercept) -306.005567
#> age -1171.063149
#> female -104.741833
#> educ -3842.035035
#> blhisp -140.119246
#> totchr -28.693773
#> ins -105.181030
#> interceptS -663.763501
#> age -2555.088757
#> female -272.477742
#> totchr -97.657576
#> ins -234.309854
#> correlation -332.668117
#>
#> $fisher_infoHG
#> (Intercept) age female educ
#> (Intercept) 3.404667e-02 -2.663191e-03 -8.710766e-04 -1.680577e-03
#> age -2.663191e-03 6.743982e-04 -1.724763e-05 2.612706e-05
#> female -8.710766e-04 -1.724763e-05 3.459587e-03 -4.828686e-05
#> educ -1.680577e-03 2.612706e-05 -4.828686e-05 1.290280e-04
#> blhisp -3.542046e-03 1.388798e-04 -2.284468e-04 1.249532e-04
#> totchr -6.839699e-04 -2.337102e-04 3.476922e-05 4.695407e-05
#> ins -4.421629e-05 -2.503278e-04 1.139025e-04 -8.434863e-06
#> income 2.029670e-05 -5.673906e-06 9.772927e-06 -3.933455e-06
#> (Intercept) -9.433646e-03 8.722436e-04 -1.491933e-04 4.020986e-04
#> age 7.376612e-04 -2.111158e-04 2.926516e-05 5.592983e-06
#> female -1.383000e-04 -2.183753e-06 -9.193475e-04 4.329439e-05
#> educ 4.832146e-04 -2.121147e-06 2.419808e-05 -3.571096e-05
#> blhisp 1.525645e-03 -5.367674e-05 -6.574146e-05 -6.327103e-05
#> totchr -3.342743e-04 5.920622e-05 1.536939e-04 1.507604e-05
#> ins -8.810030e-07 5.606009e-05 5.738355e-06 1.504525e-05
#> interceptS 1.507081e-04 1.698170e-04 -1.189579e-04 -5.435015e-05
#> age 1.090734e-04 -4.360488e-05 1.338566e-05 2.973334e-06
#> female -1.790534e-04 -6.531306e-06 -1.834293e-04 1.866647e-05
#> totchr -2.498899e-04 1.441531e-05 7.777824e-05 1.425410e-05
#> ins -5.697505e-05 1.775463e-05 2.172696e-05 3.530790e-06
#> correlation -2.531815e-03 -5.594773e-05 5.807686e-04 1.584508e-04
#> blhisp totchr ins income
#> (Intercept) -3.542046e-03 -6.839699e-04 -4.421629e-05 2.029670e-05
#> age 1.388798e-04 -2.337102e-04 -2.503278e-04 -5.673906e-06
#> female -2.284468e-04 3.476922e-05 1.139025e-04 9.772927e-06
#> educ 1.249532e-04 4.695407e-05 -8.434863e-06 -3.933455e-06
#> blhisp 3.466292e-03 -2.990862e-05 5.739402e-05 2.735989e-06
#> totchr -2.990862e-05 4.636481e-03 2.393327e-04 3.465789e-06
#> ins 5.739402e-05 2.393327e-04 3.611532e-03 -5.944946e-06
#> income 2.735989e-06 3.465789e-06 -5.944946e-06 1.460168e-06
#> (Intercept) 1.816117e-03 -1.704642e-03 -2.175975e-05 -7.773141e-06
#> age -8.581025e-05 1.410340e-04 7.168821e-05 2.687175e-07
#> female -1.184049e-04 5.193145e-04 1.485347e-05 1.566255e-06
#> educ -6.048520e-05 4.034948e-05 8.268351e-06 2.179297e-07
#> blhisp -1.156574e-03 -2.199227e-04 -9.962812e-05 -8.131891e-07
#> totchr -8.486521e-05 -1.406401e-04 -1.498868e-05 1.022438e-06
#> ins -1.099071e-04 7.254889e-05 -1.031591e-03 8.645681e-07
#> interceptS 2.872874e-04 -6.785002e-04 -6.232524e-05 -3.218343e-06
#> age -2.409094e-05 6.612002e-05 2.538089e-05 1.817499e-07
#> female -8.977561e-05 2.069415e-04 1.919980e-05 8.846887e-07
#> totchr -6.679883e-05 -3.822614e-06 9.497611e-07 7.761539e-07
#> ins -1.153324e-05 3.750596e-05 -2.416981e-04 3.926527e-07
#> correlation -6.291712e-04 1.775305e-03 2.000295e-04 9.514469e-06
#> (Intercept) age female educ
#> (Intercept) -9.433646e-03 7.376612e-04 -1.383000e-04 4.832146e-04
#> age 8.722436e-04 -2.111158e-04 -2.183753e-06 -2.121147e-06
#> female -1.491933e-04 2.926516e-05 -9.193475e-04 2.419808e-05
#> educ 4.020986e-04 5.592983e-06 4.329439e-05 -3.571096e-05
#> blhisp 1.816117e-03 -8.581025e-05 -1.184049e-04 -6.048520e-05
#> totchr -1.704642e-03 1.410340e-04 5.193145e-04 4.034948e-05
#> ins -2.175975e-05 7.168821e-05 1.485347e-05 8.268351e-06
#> income -7.773141e-06 2.687175e-07 1.566255e-06 2.179297e-07
#> (Intercept) 3.732429e-02 -2.570109e-03 -3.259217e-03 -1.530571e-03
#> age -2.570109e-03 5.600184e-04 1.332497e-04 9.406303e-06
#> female -3.259217e-03 1.332497e-04 3.071743e-03 2.734607e-05
#> educ -1.530571e-03 9.406303e-06 2.734607e-05 1.034614e-04
#> blhisp -2.448071e-03 9.917021e-05 -2.437918e-04 1.038718e-04
#> totchr -6.885166e-04 -1.110911e-04 4.370178e-05 2.173698e-05
#> ins -1.158898e-03 -7.745795e-05 2.783880e-04 -4.416614e-06
#> interceptS 3.291853e-03 -2.305634e-04 -9.326386e-04 -5.869681e-05
#> age -3.082573e-04 2.780477e-05 9.522248e-05 5.412339e-06
#> female -8.955817e-04 8.074057e-05 3.290377e-04 8.573168e-06
#> totchr -4.948810e-04 1.936972e-05 1.103999e-04 7.288908e-06
#> ins -2.202761e-04 2.826055e-06 -2.770132e-06 5.764341e-06
#> correlation -7.881285e-03 4.050032e-04 2.012913e-03 1.700494e-04
#> blhisp totchr ins interceptS
#> (Intercept) 1.525645e-03 -3.342743e-04 -8.810030e-07 1.507081e-04
#> age -5.367674e-05 5.920622e-05 5.606009e-05 1.698170e-04
#> female -6.574146e-05 1.536939e-04 5.738355e-06 -1.189579e-04
#> educ -6.327103e-05 1.507604e-05 1.504525e-05 -5.435015e-05
#> blhisp -1.156574e-03 -8.486521e-05 -1.099071e-04 2.872874e-04
#> totchr -2.199227e-04 -1.406401e-04 7.254889e-05 -6.785002e-04
#> ins -9.962812e-05 -1.498868e-05 -1.031591e-03 -6.232524e-05
#> income -8.131891e-07 1.022438e-06 8.645681e-07 -3.218343e-06
#> (Intercept) -2.448071e-03 -6.885166e-04 -1.158898e-03 3.291853e-03
#> age 9.917021e-05 -1.110911e-04 -7.745795e-05 -2.305634e-04
#> female -2.437918e-04 4.370178e-05 2.783880e-04 -9.326386e-04
#> educ 1.038718e-04 2.173698e-05 -4.416614e-06 -5.869681e-05
#> blhisp 3.332859e-03 -4.485024e-05 6.854722e-05 2.170000e-04
#> totchr -4.485024e-05 8.154044e-04 1.689070e-04 -3.065277e-04
#> ins 6.854722e-05 1.689070e-04 2.637205e-03 -2.543544e-04
#> interceptS 2.170000e-04 -3.065277e-04 -2.543544e-04 4.139431e-03
#> age -1.558760e-05 1.307147e-05 1.039407e-05 -6.972033e-04
#> female -1.067868e-05 6.013677e-05 2.844061e-05 -7.942144e-04
#> totchr -2.008410e-05 9.854475e-05 7.866485e-05 -2.091137e-04
#> ins -1.439930e-05 4.407145e-05 1.366878e-04 -2.378861e-04
#> correlation -8.525402e-04 9.969203e-04 6.777886e-04 -3.357800e-03
#> age female totchr ins
#> (Intercept) 1.090734e-04 -1.790534e-04 -2.498899e-04 -5.697505e-05
#> age -4.360488e-05 -6.531306e-06 1.441531e-05 1.775463e-05
#> female 1.338566e-05 -1.834293e-04 7.777824e-05 2.172696e-05
#> educ 2.973334e-06 1.866647e-05 1.425410e-05 3.530790e-06
#> blhisp -2.409094e-05 -8.977561e-05 -6.679883e-05 -1.153324e-05
#> totchr 6.612002e-05 2.069415e-04 -3.822614e-06 3.750596e-05
#> ins 2.538089e-05 1.919980e-05 9.497611e-07 -2.416981e-04
#> income 1.817499e-07 8.846887e-07 7.761539e-07 3.926527e-07
#> (Intercept) -3.082573e-04 -8.955817e-04 -4.948810e-04 -2.202761e-04
#> age 2.780477e-05 8.074057e-05 1.936972e-05 2.826055e-06
#> female 9.522248e-05 3.290377e-04 1.103999e-04 -2.770132e-06
#> educ 5.412339e-06 8.573168e-06 7.288908e-06 5.764341e-06
#> blhisp -1.558760e-05 -1.067868e-05 -2.008410e-05 -1.439930e-05
#> totchr 1.307147e-05 6.013677e-05 9.854475e-05 4.407145e-05
#> ins 1.039407e-05 2.844061e-05 7.866485e-05 1.366878e-04
#> interceptS -6.972033e-04 -7.942144e-04 -2.091137e-04 -2.378861e-04
#> age 1.623137e-04 4.473250e-05 -2.839810e-05 -3.477090e-05
#> female 4.473250e-05 8.117344e-04 4.233431e-05 5.823735e-05
#> totchr -2.839810e-05 4.233431e-05 3.418916e-04 4.749923e-05
#> ins -3.477090e-05 5.823735e-05 4.749923e-05 7.792913e-04
#> correlation 2.466345e-04 8.815139e-04 7.216752e-04 2.238502e-04
#> correlation
#> (Intercept) -2.531815e-03
#> age -5.594773e-05
#> female 5.807686e-04
#> educ 1.584508e-04
#> blhisp -6.291712e-04
#> totchr 1.775305e-03
#> ins 2.000295e-04
#> income 9.514469e-06
#> (Intercept) -7.881285e-03
#> age 4.050032e-04
#> female 2.012913e-03
#> educ 1.700494e-04
#> blhisp -8.525402e-04
#> totchr 9.969203e-04
#> ins 6.777886e-04
#> interceptS -3.357800e-03
#> age 2.466345e-04
#> female 8.815139e-04
#> totchr 7.216752e-04
#> ins 2.238502e-04
#> correlation 1.048150e-02
#>
#> $prop_sigmaHG
#> (Intercept) age female educ blhisp totchr
#> 0.184517394 0.025969177 0.058818252 0.011359049 0.058875220 0.068091708
#> ins income (Intercept) age female educ
#> 0.060096026 0.001208374 0.193194942 0.023664708 0.055423303 0.010171599
#> blhisp totchr ins interceptS age female
#> 0.057730917 0.028555287 0.051353725 0.064338411 0.012740240 0.028490952
#> totchr ins correlation
#> 0.018490312 0.027915789 0.102379212
#>
#> $level
#> [1] "0" "1"
#>
#> $nObs
#> [1] 3328
#>
#> $nParam
#> [1] 21
#>
#> $N0
#> [1] 526
#>
#> $N1
#> [1] 2802
#>
#> $NXS
#> [1] 8
#>
#> $NXO
#> [1] 7
#>
#> $df
#> [1] 3307
#>
#> $aic
#> [1] 11651.95
#>
#> $bic
#> [1] 11780.26
#>
#> $initial.value
#> (Intercept) age female educ blhisp totchr
#> -0.668643899 0.086814848 0.663505390 0.061883892 -0.365784312 0.795747277
#> ins income (Intercept) age female educ
#> 0.169106526 0.002677301 5.288927373 0.202466773 0.292133967 0.012388871
#> blhisp totchr ins interceptS age female
#> -0.182865733 0.500633176 -0.046509658 1.290541875 1.000000000 1.000000000
#> totchr ins correlation
#> 1.000000000 1.000000000 -0.359316986
#>
#> $NE
#> [1] 5
#>
#> $NV
#> [1] 1
#>
#> attr(,"class")
#> [1] "HeckmanGe" "list"