?=============================================================== ? DISCRETE CHOICE MODELING. Assignment 1, Part I. Binary Choice ? Based on healthcare.lpj ? This symbol: <*********** shows commands that you must ? complete with your own specification. ?=============================================================== SAMPLE ; All $ ? The years are 1984, 1985, 1986, 1987, 1988, 1991, 1994 $ ? Set the sample for the desired year. INCLUDE ; New ; Year = the year you want to analyze $ <*********** ? Descriptive statistics for the income variable DSTAT ; Quantiles ; Rhs = Income $ ? How correlated is income with other variables? REGRESS ; Lhs = Income ; Rhs = one,educ,educ*educ,age,female $ ? Male/Female split of the sample DSTAT ; Rhs = Female $ ? Define the variables to be in my model. ? Should include one, female and educ. Pick some others. NAMELIST ; xp = one,female,educ , ... $ <*********** ? Compare estimates obtained with two different models. PROBIT ; Lhs = public ; Rhs = your specification ; Table = probit $ <*********** LOGIT ; Lhs = public ; Rhs = your specification ; Table = logit $ <*********** MAKETABLE ; probit, logit $ ? Partial effects for variables in the model PARTIALS ; Effects: variable / variable ; Summary $ <*********** ? Obtain partial effects for interaction LOGIT ; Lhs = public ; Rhs = xp, female*educ ; marginal $ PARTIALS ; Effects : age / married / hsat / female / educ ; summary $ ? Structural change test. Like the Chow test for regression Model ; For [ (test) Female = *,0,1] ; Lhs = etc. $ <*********** ? Delta Method for a nonlinear function PROBIT ; lhs = public ; rhs=xp $ WALD ; if [ female=1 ] ; parameters = b ; covariance = varb ; labels = kreg_b ; fn1 = n01(b1'xp)/phi(b1'xp) $ ? Delta method for another function. Add this to the WALD command ; fn2 = 1 - fn1 *(fn1 + b1'xp) <*********** ? Try Krinsky and Robb. Add this to the command. Different answer? ; K&R <*********** ? Bootstrap standard error for IMR function PROCEDURE $ PROBIT ; quietly ; lhs = public ; rhs = xp $ CREATE ; imr = n01(b'xp)/phi(b'xp) $ CALC ; meanimr = female'imr/sum(female) $ ENDPROC $ EXEC ; n=100 ; bootstrap = meanimr ; histogram $ ? Bootstrap to look at behavior of a test statistic. PROBIT ; lhs = doctor ; rhs = xp $ (Obtains the 'true' coefficients.) CREATE ; ysim = (b'xp + rnn(0,1)) > 0 $ (Simulates the homoscedastic data) PROBIT ; Lhs = ysim ; Rhs = xp $ (this computes the restricted estimates) PROBIT ; Lhs = ysim ; Rhs = xp ; Het ; Hfn = female ; start = b,0 ; Maxit = 0 $ PROCEDURE $ PROBIT ; quietly ; lhs=ysim ; rhs = xp $ PROBIT ; quietly ; lhs=ysim ; rhs=xp ; het ; hfn=female;start=b,0 ; maxit=0 $ ENDPROC $ EXECUTE ; n=100 ; bootstrap = lmstat $ HISTOGRAM; rhs = bootstrp $ ? Bootstrap for an estimated vector. PROCEDURE $ LOGIT ; quiet ; Lhs = doctor ; Rhs = xp ; Prob = p $ CREATE ; scale = p*(1-p) $ CALC ; avgscale = xbr(scale) $ MATRIX ; ape = avgscale * b $ ENDPROC $ EXECUTE ; n = 50 ; bootstrap = ape $ ? You can compare your results to the results using the delta method by LOGIT ; quiet ; Lhs = healthy ; Rhs = xp ; Marginal $ ?=============================================================== ? DISCRETE CHOICE MODELING. Assignment 1. Panel Data ? Based on healthdata.lpj (Subset of Health Care panel) ? This symbol: <*********** shows commands that you must ? complete with your own specification. ?=============================================================== SAMPLE ; All $ SETPANEL ; Group = id ; Pds = ti $ ? Pooled MLE. Cluster estimator NAMELIST ; XP = your list of variables (do not include HEALTHY) $ <********* PROBIT ; Lhs = doctor ; Rhs = xp $ <********* PROBIT ; Lhs = doctor ; Rhs = ... ; Cluster = ID $ <********* ? Fixed effects models NAMELIST ; xfe = your 3 variables $ (for example, age, income, hhkids) <********* LOGIT ; Lhs = doctor ; Rhs = xfe ; Panel ; Table = logit_c $ LOGIT ; Lhs = doctor ; Rhs = xfe ; Panel ; FEM ; Table = logit_u $ MAKETABLE ; logit_c,logit_u $ ? Random Effects; Quadrature and Simulation PROBIT ; Lhs = doctor ; Rhs = one, ... ; Panel ; Random $ (B&M) <********* PROBIT ; Lhs = doctor ; Rhs = one, ... ; Panel ; RPM ; Fcn = one(n) ; Halton ; Pts = 50 $ <*********