/* Basic Program */ title ; Employment Probability probit ; lhs = emp ; rhs = one,ed,urb,minor,lofinc ; maxit = 1000 ; start = 0,0,0,0,0 ; tlf = 0.00001 ; tlb = 0.00001 ; tbg = 0.00001 ; alg = newton ? Can choose bhhh, bfgs, dfp, stedes ; margin $ ? estimate p = Pr(y=1) at sample mean ? Saving estimates and covariance matrix matrix ; prb = b ; prc = varb $ ? Saving the value of likelihood function calc ; plogl = logl $ /* Testing hypotheses */ /* In LIMDEP7, Wald tests can be computed for any restriction LM or LR tests can be computed for certain restrictions: equality between parameters or zero restriction For example, Hypo 1: b(1) = 0, b(2) = b(3) Hypo 2: b(1) = 0, b(2) = b(3), b(4) = b(2)+ b(3) + b(4) Hypo 2: b(1) = 0, b(2) = b(3), b(4)^2 = b(5) Wald can be used for any of these hypotheses. LR or LM can be used only for Hypo 1. */ /* Testing hypo 1 */ ? Unrestricted Model namelist ; x = one,ed,urb,minor,lofinc $ probit ; lhs = emp ; rhs = x ; maxit = 1000 $ matrix ; uprb = b ; uprc = varb $ calc ; ulogl = logl $ ? Restricted Model probit ; lhs = emp ; rhs = x ; maxit = 1000 ; rst = 0,b2,b2,b4,b5 $ matrix ; rprb = b $ calc ; rlogl = logl $ ? [Wald Test] title; Wald test for b1 = 0 and b2 = b3 $ wald ; labels = b1,b2,b3,b4,b5 ; start = uprb ; var = uprc ; fn1 = b1 ; fn2 = b2 - b3 $ ? [LR test] title; LR test for b1 = 0 and b2 = b3 $ calc ; list ; lrt = 2*(ulogl - rlogl) ; pval = 1 - chi(lrt,2) $ ? [LM test] probit ; lhs = emp ; rhs = x ; start = rprb ; maxit = 0 $ title ; LM test for b1 = 0 and b2 = b3 $ calc ; list ; lmt = lmstat ; pval = 1 - chi(lmt,2) $ /* Wald for hypo 3 */ title; Wald test for b1 = 0, b2 = b3 and b4^4 = b5 $ wald ; labels = b1,b2,b3,b4,b5 ; start = uprb ; var = uprc ; fn1 = b1 ; fn2 = b2 - b3 ; fn3 = b4^2 - b5 $ /* Estimating Pr(y=1) and dPr(y=1)/dx_j */ ? Estimating Pr(y=1) at mean of x ? Based on unrestricted probit matrix ; mx = mean(x) $ ? It is a column vector calc ; xb1 = mx(1,1) ; xb2 = mx(2,1) ; xb3 = mx(3,1) ; xb4 = mx(4,1) ; xb5 = mx(5,1) $ title ; Pr(emp=1) at means of regressors $ wald ; labels = b1,b2,b3,b4,b5 ; start = uprb ; var = uprc ; fn1 = phi(xb1*b1+xb2*b2+xb3*b3+xb4*b4+xb5*b5) $ ? Estimating dPr(y=1)/dx title ; Marginal effects $ wald ; labels = b1,b2,b3,b4,b5 ; start = uprb ; var = uprc ; fn1 = xb1*b1+xb2*b2+xb3*b3+xb4*b4+xb5*b5 ; fn2 = n01(fn1)*b1 ; fn3 = n01(fn1)*b2 ; fn4 = n01(fn1)*b3 $