Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: metrics
See also: heckman select powell andrews sir sir1 sir2

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).

Reference(s):

Usage: res = sssm(vectY,matX,nameX {,auto,vObs,vSel,nbslices})
Input:
vectY n x 1 vector, the observed response variable. (The missing values are coded as zero.)
matX n x p matrix, the observed explanatory variables.
nameX p x 1 string vector, the names of the explanatory variables.
auto optional scalar, default: auto=1. If auto<>0, the explanatory variables used in the outcome equation and in the selection equation will be selected by user in selectitem windows during the execution of this quantlet. For auto==0, you have to specify input vectors "vObs" and "vSel".
vObs p x 1 vector, the indicator vector of the explanatory variables used in the outcome equation. (1 for the selected explanatory variable, 0 otherwise.) If auto==0, vObs has to be specified. If auto<>0, input value of vObs will not be used; the explanatory variables will be specified interactively during the execution of the quantlet.
vSel p x 1 vector, the indicator vector of the explanatory variables used in the selection equation. (1 for the selected explanatory variable, 0 otherwise.) If auto==0, vSel has to be specified. If auto<>0, input value of vSel will not be used; the explanatory variables will be specified interactively during the execution of the quantlet.
nbslices optional scalar, the number of slices for the non-missing yi observations in the S.I.R. step. By default, the number of slices is 5 (plus 1 slice for the missing yi cases).
Output:
res.gamma1 (sum(vObs==1) x 1) vector, estimate of the observation slope vector.
res.gamma2 (sum(vSel==1) x 1) vector, estimate of the selection slope vector.

Note:

Example:
library("metrics")
randomize(1102)
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

Result:
The estimates of the outcome and selection slope vectors. The second
set of results depends on the user's choice of variables.

Contents of gamma1
[1,]  0.44168
[2,]  0.60905
[3,]  0.46188
[4,]  0.46972

Contents of gamma2
[1,]  0.52426
[2,]  0.57761
[3,] -0.44681
[4,] -0.43804



Author: J. Saracco, 20030121 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006