1 / 45

Regression with a Binary Dependent Variable (SW Ch. 9)

Regression with a Binary Dependent Variable (SW Ch. 9). data:hmda_aer. keep or drop. Data set reduction. drop if (s51==3) *multifamily* drop if (s7==4)|(s7==5) *application withdrawn or file incomplete* keep if (s4==1) *purpose of loan is home purchase* keep if (s13==3)|(s13==5).

haruki
Télécharger la présentation

Regression with a Binary Dependent Variable (SW Ch. 9)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Regression with a Binary Dependent Variable(SW Ch. 9)

  2. data:hmda_aer

  3. keep or drop

  4. Data set reduction • drop if (s51==3) *multifamily* • drop if (s7==4)|(s7==5) *application withdrawn or file incomplete* • keep if (s4==1) *purpose of loan is home purchase* • keep if (s13==3)|(s13==5)

  5. gen deny = (s7==3) • gen pi_rat = s46/100 • gen black = (s13==3)

  6. sort black

  7. summarize deny if (black==1) • summarize deny if (black==0)

  8. regress deny pi_rat, r

  9. regress deny pi_rat black, r

  10. probit deny pi_rat, r

  11. probit deny pi_rat black, r

  12. logit deny pi_rat black, r

  13. gen hse_inc = s45/100 • gen loan_val = s6/s50 • gen ccred = s43 • gen mcred = s42 • gen pubrec = (s44>0) • gen denpmi = (s53==1) • gen selfemp = (s27a==1) • gen married = (s23a=="M")

  14. gen single = (married==0) • gen hischl = (school>=12) • gen probunmp = uria • gen condo = (s51 == 1)

  15. sum pi_rat hse_inc loan_val ccred mcred pubrec denpmi selfemp single hischl probunmp condo black deny

  16. gen ltv_med = (loan_val>=0.80)*(loan_val<=.95) • gen ltv_high = (loan_val>0.95) • gen blk_pi = black*pi_rat • gen blk_hse = black*hse_inc • gen ccred3 = (ccred==3) • gen ccred4 = (ccred==4) • gen ccred5 = (ccred==5) • gen ccred6 = (ccred==6) • gen mcred3 = (mcred==3) • gen mcred4 = (mcred==4)

  17. Preliminary Analysis ... compute means of all variables • sum deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp single hischl probunmp mcred3 mcred4 ccred3 ccred4 ccred5 ccred6 condo

  18. regress deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp, r

  19. logit deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp

  20. logit deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp, r

  21. scalar w0 = _b[black]*0 + _b[ pi_rat]* .3308136 + _b[ hse_inc]* .2553461 + _b[ ltv_med]* .3743697 + _b[ltv_high]* .0323529 + _b[ ccred]* 2.116387 + _b[ mcred]* 1.721008 + _b[ pubrec]* .0735294 + _b[ denpmi]* .0201681 + _b[ selfemp]* .1163866 + _b[ _cons]* 1

  22. scalar w1 = w0 + _b[black]*1 • dis "Prob for white at means = " 1/(1+exp(-w0)) • dis "Prob for black at means = " 1/(1+exp(-w1)) • dis "Difference in probs = " (1/(1+exp(-w1))) - (1/(1+exp(-w0)))

  23. probit deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp

  24. probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp, r

  25. scalar z0 = _b[black]*0 + _b[ pi_rat]* .3308136 + _b[ hse_inc]* .2553461 + _b[ ltv_med]* .3743697 + _b[ltv_high]* .0323529 + _b[ ccred]* 2.116387 + _b[ mcred]* 1.721008 + _b[ pubrec]* .0735294 + _b[ denpmi]* .0201681 + _b[ selfemp]* .1163866 + _b[ _cons]* 1

  26. scalar z1 = z0 + _b[black]*1 • dis "Prob for white at means = " normprob(z0) • dis "Prob for black at means = " normprob(z1) • dis "Difference in probs = " normprob(z1)-normprob(z0)

  27. probit deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp single hischlprobunmp

  28. test single hischlprobunmp

  29. probit deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp single hischlprobunmp, r

  30. scalar z0 = _b[black]*0+ _b[ pi_rat]* .3308136 + _b[ hse_inc]* .2553461 + _b[ ltv_med]* .3743697 + _b[ltv_high]* .0323529 + _b[ ccred]* 2.116387 + _b[ mcred]* 1.721008 + _b[ pubrec]* .0735294 + _b[ denpmi]* .0201681 + _b[ selfemp]* .1163866 + _b[ single]* .3932773 + _b[ hischl]* .9836134 + _b[probunmp]* 3.774496 + _b[ _cons]* 1

  31. scalar z1 = z0 + _b[black]*1 • dis "Prob for white at means = " normprob(z0) • dis "Prob for black at means = " normprob(z1) • dis "Difference in probs = " normprob(z1)-normprob(z0) • test single hischl probunmp

  32. probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp single hischl probunmp mcred3 mcred4 ccred3 ccred4 ccred5 ccred6 condo

  33. test single hischl probunmp • test mcred3 mcred4 ccred3 ccred4 ccred5 ccred6 • test condo

  34. probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp single hischl probunmp mcred3 mcred4 ccred3 ccred4 ccred5 ccred6 condo, r

  35. scalar z0 = _b[black]*0 + _b[ pi_rat]* .3308136 + _b[ hse_inc]* .2553461 + _b[ ltv_med]* .3743697 + _b[ltv_high]* .0323529 + _b[ ccred]* 2.116387 + _b[ mcred]* 1.721008 + _b[ pubrec]* .0735294 + _b[ denpmi]* .0201681 + _b[ selfemp]* .1163866 + _b[ single]* .3932773 + _b[ hischl]* .9836134 + _b[probunmp]* 3.774496 + _b[ mcred3]* .0172269 + _b[ mcred4]* .0088235 + _b[ ccred3]* .0529412 + _b[ ccred4]* .0323529 + _b[ ccred5]* .0764706 + _b[ ccred6]* .0844538 + _b[ condo]* .2882353 + _b[ _cons]* 1

  36. scalar z1 = z0 + _b[black]*1 • dis "Prob for white at means = " normprob(z0) • dis "Prob for black at means = " normprob(z1) • dis "Difference in probs = " normprob(z1)-normprob(z0)

  37. test single hischlprobunmp • test mcred3 mcred4 ccred3 ccred4 ccred5 ccred6 • test condo

  38. probit deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp single hischlprobunmpblk_piblk_hse

  39. test single hischlprobunmp • test black blk_piblk_hse • test blk_piblk_hse

  40. probit deny black pi_rathse_incltv_medltv_highccredmcredpubrecdenpmiselfemp single hischlprobunmpblk_piblk_hse, r

  41. scalar z0 = _b[black]*0 + _b[ pi_rat]* .3308136 + _b[ hse_inc]* .2553461 + _b[ ltv_med]* .3743697 + _b[ltv_high]* .0323529 + _b[ ccred]* 2.116387 + _b[ mcred]* 1.721008 + _b[ pubrec]* .0735294 + _b[ selfemp]* .1163866 + _b[ denpmi]* .0201681 + _b[ single]* .3932773 + _b[ hischl]* .9836134 + _b[probunmp]* 3.774496 + _b[ _cons]* 1;

  42. scalar z1 = z0 + _b[black]*1 + _b[blk_pi]*1* .3308136 + _b[blk_hse]*1* .2553461 • dis "Prob for white at means = " normprob(z0) • dis "Prob for black at means = " normprob(z1) • dis "Difference in probs = " normprob(z1)-normprob(z0)

  43. test single hischl probunmp • test black blk_pi blk_hse • test blk_pi blk_hse

More Related