/
Chapter 7 – Binary or Zero/one or Dummy Variables Chapter 7 – Binary or Zero/one or Dummy Variables

Chapter 7 – Binary or Zero/one or Dummy Variables - PowerPoint Presentation

myesha-ticknor
myesha-ticknor . @myesha-ticknor
Follow
352 views
Uploaded On 2019-12-05

Chapter 7 – Binary or Zero/one or Dummy Variables - PPT Presentation

Chapter 7 Binary or Zeroone or Dummy Variables Dummy Variables Example Example WAGE1 Data Set We want to fit the model The term female is a dummy variable and takes into account the effect of female vs male ID: 769252

wage female variables dummy female wage dummy variables data set married coef wage1 male single model pconstant check educ

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Chapter 7 – Binary or Zero/one or Dumm..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Chapter 7 – Binary or Zero/one or Dummy Variables

Dummy Variables – Example

Example – WAGE1 Data Set We want to fit the model : The term female is a dummy variable and takes into account the effect of female vs. male.  

Example – WAGE1 Data Set We want to fit the model : The regression equation is wage = 0.623 - 2.27 female + 0.506 educ Predictor Coef SE Coef T PConstant 0.6228 0.6725 0.93 0.355female -2.2734 0.2790 -8.15 0.000educ 0.50645 0.05039 10.05 0.000S = 3.18552 R-Sq = 25.9% R-Sq(adj) = 25.6%  

Example – WAGE1 Data Set We want to fit the model : Interpretation of fitted model: wage = 0.623 - 2.27 female + 0.506 educ The coefficient on female measures the average difference in hourly wage between a woman and a man (for this model).  

Graphical Interpretation of Sex Effect

Example – WAGE1 Data Set Interpretation of fitted model: wage = 0.623 - 2.27 female + 0.506 educ The wage differential between females and males of -2.27 dollars per hour is due to sex of the individual and, potentially, factors we have not controlled for.

Example – WAGE1 Data Set Now, fit the model : This allows us to test the hypotheses: Ho: -> mean wage same for the sexes H1:-> mean wage different for the sexes 

H o : H 1: The regression equation is wage = 7.10 - 2.51 female Predictor Coef SE Coef T PConstant 7.0995 0.2100 33.81 0.000female -2.5118 0.3034 -8.28 0.000  

H o : H 1:The alternative hypothesis is supported – there is a statistically significant difference in mean wage between the sexes, p-value ≈ 0 

wage = 7.10 - 2.51 female Estimated mean wage of males is $7.10 per hour Estimate mean wage of females is $7.10 – 2.51 = $4.59 per hour

Example – WAGE1 Data Set What is the effect (if any) on wage of a person’s marital status? (Did you check your regression assumptions?)

Example – WAGE1 Data Set Examine the effect on wage of a few of the other dummy variables in this data set.

Example – WAGE1 Data Set What is the interpretation of a dummy variable if the response is log(y)? Now, fit the model : Log( 

Example – WAGE1 Data Set lwage = 1.81 - 0.397 female Predictor Coef SE Coef T PConstant 1.81357 0.02981 60.83 0.000Female -0.39722 0.04307 -9.22 0.000 About 40% decrease in hourly wage if individual is female!

Example – WAGE1 Data Set How do we handle multiple dummy variables at once? Consider the two variables married and female. We have four categories: single male, single female, married male, and married female.

We have four categories: single male, single female, married male, and married female. Need to create three new dummy variables Marriedmale Marriedfemale SinglefemaleSingle Male000Married Male100Single Female001Married Female 0 1 0

We have four categories: single male, single female, married male, and married female. Need to create three new dummy variables In order to create the dummy variables marriedmale , marriedfemale, and singlefemale, use the calculator and a nested and statement within an if statement in Minitab.

We have four categories: single male, single female, married male, and married female. wage = 5.17 + 2.82 marriedmale - 0.602 marriedfemale - 0.556 singlefemalePredictor Coef SE Coef T PConstant 5.1680 0.3614 14.30 0.000marriedmale 2.8150 0.4363 6.45 0.000marriedfemale -0.6021 0.4645 -1.30 0.195singlefemale - 0.5564 0.4736 -1.18 0.241S = 3.35181 R-Sq = 18.1% R-Sq(adj) = 17.6%

Did you check the assumptions of homoskedasticity and normality?

We have four categories: single male, single female, married male, and married female. lwage = 1.52 + 0.427 marriedmale - 0.0797 marriedfemale - 0.132 singlefemalePredictor Coef SE Coef T PConstant 1.52081 0.05099 29.83 0.000marriedmale 0.42668 0.06155 6.93 0.000marriedfemale -0.07974 0.06552 -1.22 0.224 singlefemale -0.13164 0.06680 -1.97 0.049S = 0.472836 R-Sq = 21.3% R-Sq(adj) = 20.9%

Did you check the assumptions of homoskedasticity and normality?

lwage = 0.321 + 0.213 marriedmale - 0.198 marriedfemale - 0.110 singlefemale + 0.0789 educ + 0.0268 exper - 0.000535 expersq + 0.0291 tenure - 0.000533 tenursqPredictor Coef SE Coef T PConstant 0.3214 0.1000 3.21 0.001marriedmale 0.21268 0.05536 3.84 0.000 marriedfemale -0.19827 0.05784 -3.43 0.001singlefemale -0.11035 0.05574 1.98 0.048educ 0.078910 0.006694 11.79 0.000exper 0.026801 0.005243 5.11 0.000expersq -0.0005352 0.0001104 -4.85 0.000tenure 0.029088 0.006762 4.30 0.000 tenursq - 0.0005331 0.0002312 - 2.31 0.022 S = 0.393290 R-Sq = 46.1% R-Sq(adj) = 45.3%

Did you check the assumptions of homoskedasticity and normality?

Example – BEAUTY Data Set Do looks affect hourly wage? Variable: looks Has five levels: 1, 2, 3, 4, 5 Make dummy variables where: 1, 2 – below average3 – average4, 5 – above average

Example – BEAUTY Data Set Do looks affect hourly wage? Make dummy variables where: 1, 2 – below average 3 – average4, 5 – above averageYou only need two dummy variables: belowaverage and aboveaverage

Example – BEAUTY Data Set Do looks affect hourly wage? Your conclusions? Did you check assumptions?

Example – BEAUTY Data Set Do looks affect hourly wage? Now, run a separate analysis for females and for males. Your conclusions? Did you check assumptions?

Dummy Variables and the Interaction Term Consider the Wage1 data set. Response: log(wage) Predictor variables: female, married, female*married, educ, exper, exper^2, tenure, and tenure^2.NOTE: need to run this model in general linear regression of Minitab

Dummy Variables and the Interaction Term Term Coef SE Coef T PConstant 0.321378 0.100009 3.2135 0.001female -0.110350 0.055742 -1.9797 0.048married 0.212676 0.055357 3.8419 0.000female*married -0.300593 0.071767 -4.1885 0.000educ 0.078910 0.006694 11.7873 0.000 exper 0.026801 0.005243 5.1118 0.000expersq -0.000535 0.000110 -4.8471 0.000tenure 0.029088 0.006762 4.3016 0.000tenursq -0.000533 0.000231 -2.3056 0.022Summary of ModelR-Sq = 46.09% R-Sq(adj) = 45.25%

Dummy Variables and the Interaction Term lwage = 0.321378 - 0.11035 female + 0.212676 married + 0.0789103 educ + 0.0268006 exper - 0.000535245 expersq + 0.0290875 tenure -0.000533142 tenursq - 0.300593 female*marriedInterpretation of dummy variables coefficients.

Example – Problem C7.2 Complete C7.2 ( i ), (iii), and (iv) in class