Library: | metrics |
See also: | heckman select powell andrews |
Quantlet: | sssm | |
Description: | computes the estimates of the slope vectors in the outcome equation and in the selection equation for a semiparametric sample selection model (SSSM). This is a two-stages estimation method: the first one is a taylored Sliced Inverse Regression (S.I.R.) analysis, and, in the second one, two Canonical analyses are conducted in order to convert the estimated EDR directions into estimates of the slopes. The identifiability conditions have to be verified: there exists a component of the explanatory variable X which affects the selection and does not affect the outcome, and there also exists another component of X which affects the outcome and does not affect the selection. If these identifiability conditions are not verified, the program stops. Moreover, the number of explanatory variables for the selection (resp. outcome) equation must be greater or equal than 2. |
Usage: | (gamma1, gamma2) = sssm (vectY,matX,nameX{,auto,vObs,vSel,nbslices}) | |
Input: | ||
vectY | n x 1 matrix containing the observed response variable. (The missing values are assumed to be equal to zero.) | |
matX | n x p matrix containing the observed explanatory variables. | |
nameX | p x 1 matrix containing the names of the explanatory variables. | |
auto | optional parameter, (by default, auto=1). If (auto=0), then you have to specify the vectors "vObs" and "vSel", else (auto=1) you have to specify your selection of the explanatory variables used in the outcome equation and in the selection equation during the execution of this macro in two selectitem windows. | |
vObs | optional parameter if auto=0, otherwise, p x 1 matrix containing the indicator vector of the explanatory variables used in the outcome equation. (1 if the explanatory variable is selected, 0 otherwise.) | |
vSel | optional parameter if auto=0, otherwise, p x 1 matrix containing the indicator vector of the explanatory variables used in the selection equation. (1 if the explanatory variable is selected, 0 otherwise.) | |
nbslices | optional parameter, scalar which gives the number of slices (for the non missing yi observations) in the S.I.R. step. (By default, the number of slices is 5 (+ 1 slice for the missing yi cases).) | |
Output: | ||
gamma1 | estimate of the observation slope vector. | |
gamma2 | estimate of the selection slope vector. |
library("metrics") n=500 sigmaU=#(1,0.5)~#(0.5,1) sigmaX=diag(#(1,1,1,1,1)) gamma1=#(1,1,1,1) gamma2=#(1,1,-1,-1) v1=#(1,1,1,1,0) v2=#(0,1,1,1,1) U=gennorm(n,#(0,0),sigmaU) X=gennorm(n,#(0,0,0,0,0),sigmaX) xselec=(X[,2:5]*gamma2)+U[,2] indexSelec=( xselec.>=0) Yall=exp(X[,1:4]*gamma1+U[,1]) Y=Yall.*indexSelec nameX="x1"|"x2"|"x3"|"x4"|"x5" rsssm=sssm(Y,X,nameX,0,v1,v2) rsssm.gamma1 rsssm.gamma2 rsssm=sssm(Y,X,nameX) rsssm.gamma1 rsssm.gamma2
the estimates of the outcome and selection slope vectors.
Library: | metrics |
See also: | heckman select powell andrews |