* * Examples from section 13.3-13.6, pp 415-425 * open data cps88.asc data(format=prn,org=columns) 1 1000 age exp2 grade ind1 married lnwage occ1 partt potexp union weight high * table(smpl=union,title="Statistics for Union Members") / potexp exp2 grade married high table(smpl=.not.union,title="Statistics for Non-Union Members") / potexp exp2 grade married high * * Fit a linear probability model. Do a histogram of the predicted "probabilities" * linreg union # potexp exp2 grade married high constant prj fitlp density(type=histogram) fitlp / gx fx scatter(style=bargraph,footer="Figure 13.3 Histogram of Predicted Values from a LPM") # gx fx * * Probit model (page 421). Show a scatter graph of the predicted probabilites of * the probit vs the LPM. Include the 45 degree line on the graph. * ddv(dist=probit) union # potexp exp2 grade married high constant prj(dist=probit,cdf=fitprb) scatter(style=dots,lines=||0.0,1.0||,footer="Figure 13.6 Probit vs Linear Probability Model",$ hlabel="Predicted Probability(Probit)",vlabel="Predicted Probability(LP)") # fitprb fitlp * * Evaluate the predicted effect of switching industries on individuals currently * in low union industries. This is done by evaluating the predicted probabilities * with the value of "high" turned for all the individuals, then knocking out of * the sample those who were already in a high union industry. The predicted * probabilities are obtained by "dotting" the coefficients with the required set * of variables, then evaluating the normal cdf (%cdf) at those values. * set z = %dot(%beta,||potexp,exp2,grade,married,1,1||) set highprb = %if(high,%na,%cdf(z)) scatter(style=dots,vmin=0.0,lines=||0.0,1.0||,$ footer="Figure 13.5 Effect of Industrial Affiliation on Workers in Low-Union Industries") # fitprb highprb * * Logit model (page 424) * ddv(dist=logit) union # potexp exp2 grade married high constant prj(dist=logit,cdf=fitlgt) scatter(style=dots,lines=||0.0,1.0||,footer="Figure 13.7 Probit vs Logit Model",$ hlabel="Predicted Probability(Probit)",vlabel="Predicted Probability(Logit)") # fitprb fitlgt