?=================================================================== ? Selection model with tobit selection equation. = ? = ? User must define the data matrix with the following line: = ? = ? NAMELIST ; X = ... $ = ? = ? User's dependent variable is Y. Change the following line = ? = ? CREATE ; Y = the dependent variable $ = ? = ? User must define the data matrix for the tobit model with = ? = ? NAMELIST ; V = ... $ = ? = ? Tobit dependent variable is Z. Change the following line = ? = ? CREATE ; Z = the dependent variable $ = ? = ? Lower and Upper must now be set to define the lower and upper ? limits of the selection region for y2. Either or both may be ? infinite. For minus or plus infinity, use 10000 or -10000. ? These may be different from those used in the Tobit model. For ? example, if the limit values used in estimation were 0 and 1 and ? you want to select those at the upper limit value of 1 you would ? set Lower=1 and Upper=10000 in the command below. Do note, in ? all cases, BOTH values must be provided below, even if one of ? them is plus infinity or minus infinity. (*) CALC ; Lower = ... ; Upper = ... $ ?==================================================================== ? None of the commands below require any modification. ?==================================================================== ? Pick up tobit estimates, å and rho. Transform. Then get ? appropriate asymptotic covariance matrix for transformed estimates. TOBIT ; LHS = z ; RHS = V ; PAR $ CALC ; kz = col(v) ; eta = 1/s ; etasq = -eta^2$ MATRIX ; beta = part(b,1,kz) ; k11 = eta * iden(kz) ; k12 = etasq * beta ; k21 = init(1,kz,0) ; k22 = etasq ; K = k11,k12 / k21,k22 ; SG = K | VARB | K' ; gamma = eta * beta $ ? Isolate the selected sample. REJECT ; y <= lower + y >= upper $ ? Variables needed to compute estimates and asymptotic covariance matrix. CREATE ; zgamma = dot(z,gamma) $ ; zu = eta * upper - zgamma ; fu = n01(zu) ; pu = phi(zu) ; zl = eta * lower - zgamma ; fl = n01(zl) ; pl = phi(zl) ; pul = pu - pl ; lambda = (fl-fu) / pul ; delta = (zl*fl - zu*fu) / pul - lambda ^ 2 ; dldeta = (upper*fu*(zu -lambda) - lower*fl*(zl-lambda)) / pul $ ? Compute slopes in selectivity corrected regression ? Pick up a) c1=slope on lambda ? b) sigma(1) = OLS disturbance standard deviation ? c) b1=full set of slopes including c1 ? Compute consistent estimates of sigma-squared and rho-squared REGRESS ; lhs = y ; rhs = X,lambda $ MATRIX ; b1 = b $ CALC ; c1 = b(kreg) ; csq = c1 ^ 2 ; sigma1 = sqr(s ^ 2 - csq * xbr(delta)) ; rho12 = c1 / sigma1 $ ? Compute components of variance matrix. THETA = åý(1 - rhoýë) CREATE ; theta = sigma1 - c1 ^ 2 * delta ; delta=abs(delta) $ ? Matrix components. We must deal with an extra column because of å. ? NAMES ; xt = x1,lambda $ MATRIX ; psi1 = xdot(xt,xt,theta) ; f1 = xdot(xt,xt,delta) ; f2 = xdot(xt,one,dldeta) ; f = f1,f2 ; xxi = xpxi(xt) ; C = xdot(xt,xt,theta) & csq * f | SG | f' ; C = xxi | C | xxi ; stat(b1,f) $