+ All Categories
Home > Documents > Regression with a Binary Dependent Variable (SW Ch. 9)

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

Date post: 25-Feb-2016
Category:
Upload: haruki
View: 64 times
Download: 1 times
Share this document with a friend
Description:
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). - PowerPoint PPT Presentation
45
Regression with a Binary Dependent Variable (SW Ch. 9)
Transcript
Page 1: Regression with a Binary Dependent Variable (SW Ch. 9)

Regression with a Binary Dependent Variable

(SW Ch. 9)

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

data:hmda_aer

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

keep or drop

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

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)

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

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

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

sort black

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

summarize deny if (black==1) summarize deny if (black==0)

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

regress deny pi_rat, r

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

regress deny pi_rat black, r

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

probit deny pi_rat, r

Page 11: Regression with a Binary Dependent Variable (SW Ch. 9)
Page 12: Regression with a Binary Dependent Variable (SW Ch. 9)

probit deny pi_rat black, r

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

logit deny pi_rat black, r

Page 14: Regression with a Binary Dependent Variable (SW Ch. 9)
Page 15: Regression with a Binary Dependent Variable (SW Ch. 9)

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")

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

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

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

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

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

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)

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

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

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

regress deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp, r

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

logit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp

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

logit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp, r

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

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

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

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)))

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

probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp

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

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

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

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

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

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)

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

probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp single hischl probunmp

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

test single hischl probunmp

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

probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp single hischl probunmp, r

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

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

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

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

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

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

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

test single hischl probunmp test mcred3 mcred4 ccred3 ccred4 ccred5

ccred6 test condo

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

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

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

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

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

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)

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

test single hischl probunmp test mcred3 mcred4 ccred3 ccred4 ccred5

ccred6 test condo

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

probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp single hischl probunmp blk_pi blk_hse

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

test single hischl probunmp test black blk_pi blk_hse test blk_pi blk_hse

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

probit deny black pi_rat hse_inc ltv_med ltv_high ccred mcred pubrec denpmi selfemp single hischl probunmp blk_pi blk_hse, r

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

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;

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

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)

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

test single hischl probunmp test black blk_pi blk_hse test blk_pi blk_hse


Recommended