Topics A Dichotomous explanatory variable Polytomous Explanatory Variables Modeling Interactions The Principle of Marginality 2010 by John Fox York SPIDA DummyVariable Regression 2 A Dichotomous Explanatory Variable The simplest case one dichotomous ID: 80594
Download Pdf The PPT/PDF document "York SPIDA John Fox Notes DummyVariable ..." 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.
Dummy-VariableRegression1.TopicsADichotomousexplanatoryvariablePolytomousExplanatoryVariablesModelingInteractionsThePrincipleofMarginality2010byJohnFoxYorkSPIDA Dummy-VariableRegression2.ADichotomousExplanatoryVariableThesimplestcase:onedichotomousandonequantitativeexplanatoryvariable.Relationshipsareadditivethepartialeffectofeachexplanatoryvariableisthesameregardlessofthespecicvalueatwhichtheotherexplanatoryvariableisheldconstant.Theotherassumptionsoftheregressionmodelhold.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionThemotivationforincludingaqualitativeexplanatoryvariableisthesameasforincludinganadditionalquantitativeexplanatoryvariable:toaccountmorefullyfortheresponsevariable,bymakingtheerrorssmaller;andtoavoidabiasedassessmentoftheimpactofanexplanatoryvariable,asaconsequenceofomittinganotherexplanatoryvariablesthatisrelatedtoit.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionFigure1representsidealizedexamples,showingtherelationshipbetweeneducationandincomeamongwomenandmen.Inbothcases,thewithin-genderregressionsofincomeoneducationareparallel.Parallelregressionsimplyadditiveeffectsofeducationandgenderonincome.In(a),genderandeducationareunrelatedtoeachother:Ifweignoregenderandregressincomeoneducationalone,weobtainthesameslopeasisproducedbytheseparatewithin-genderregressions;ignoringgenderinatesthesizeoftheerrors,however.In(b)genderandeducationarerelated,andthereforeifweregressincomeoneducationalone,wearriveatabiasedassessmentoftheeffectofeducationonincome.Theoverallregressionofincomeoneducationhasanegativeslopeeventhoughthewithin-genderregressionshavepositiveslopes.2010byJohnFoxYorkSPIDA Dummy-VariableRegression (a)EducationIncome MenWomen (b)EducationIncome MenWomenFigure1.Inbothcasesthewithin-genderregressionsofincomeoneduca-tionareparallel:in(a)genderandeducationareunrelated;in(b)womenhavehigheraverageeducationthanmen.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionWecouldperformseparateregressionsforwomenandmen.Thisapproachisreasonable,butithasitslimitations:Fittingseparateregressionsmakesitdifculttoestimateandtestforgenderdifferencesinincome.Furthermore,ifwecanassumeparallelregressions,thenwecanmorecientlyestimatethecommoneducationslopebypoolingsampledatafrombothgroups.2010byJohnFoxYorkSPIDA Dummy-VariableRegression2.0.1IntroducingaDummyRegressorOnewayofformulatingthecommon-slopemodelis,calledadummy-variableregressororanindicatorvariable,iscoded1formenand0forwomen:formenforwomenThus,forwomenthemodelbecomes(0)+andformen(1)+TheseregressionequationsaregraphedinFigure2.2010byJohnFoxYorkSPIDA Dummy-VariableRegression ï¡ï«ï§Figure2.Theparametersintheadditivedummy-regressionmodel.2010byJohnFoxYorkSPIDA Dummy-VariableRegression2.1Regressorsvs.ExplanatoryVariablesThisisourinitialencounterwithanideathatisfundamentaltomanylinearmodels:thedistinctionbetweenexplanatoryvariablesregressors.Here,isaqualitativeexplanatoryvariable(orfactor),withcategories(alsocalledlevelsfemaleThedummyvariableisaregressor,representingtheexplanatoryvariablegender.Incontrast,thequantitativeexplanatoryvariable(orcovariateandtheregressorareoneandthesame.Wewillseelaterthatanexplanatoryvariablecangiverisetoseveralregressors,andthatsomeregressorsarefunctionsofmorethanoneexplanatoryvariable.2010byJohnFoxYorkSPIDA Dummy-VariableRegression2.2HowDummyRegressionWorksInterpretationofparametersintheadditivedummy-regressionmodel:givesthedifferenceininterceptsforthetworegressionlines.Becausetheseregressionlinesareparallel,alsorepresentstheconstantseparationbetweenthelinestheexpectedincomeadvantageaccruingtomenwheneducationisheldconstant.Ifmenweredisadvantagedrelativetowomen,thenwouldbenegativegivestheinterceptforwomen,forwhomisthecommonwithin-gendereducationslope.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionEssentiallysimilarresultsareobtainedifwecodezeroformenandoneforwomen(Figure3):Thesignofisreversed,butitsmagnituderemainsthesame.Thecoefnowgivestheincomeinterceptformen.Itisthereforeimmaterialwhichgroupiscodedoneandwhichiscodedzero.2010byJohnFoxYorkSPIDA Dummy-VariableRegression ï¡ï«ï§Figure3.Parameterscorrespondingtothealternativecodingformenandforwomen.2010byJohnFoxYorkSPIDA Dummy-VariableRegression3.PolytomousExplanatoryVariablesConsidertheregressionoftheratedprestigeofoccupationsontheirincomeandeducationlevels.Letusclassifytheoccupationsintothreecategories:(1)professionalandmanagerial;(2)white-collar;and(3)blue-collar.-categoryclassicationcanberepresentedintheregressionequationbyintroducingtwodummyregressors:Category BlueCollar WhiteCollar Professional&Managerial Theregressionmodelisthenisincomeandiseducation.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionThismodeldescribesthreeparallelregressionplanes,whichcandifferintheirintercepts(seeFigure4):BlueCollar:WhiteCollar:Professional:givestheinterceptforblue-collaroccupations.representstheconstantverticaldistancebetweentheregressionplanesforwhite-collarandblue-collaroccupations.representstheconstantverticaldifferencebetweentheparallelregressionplanesforprofessionalandblue-collaroccupations(thevaluesofeducationandincome).Blue-collaroccupationsarecoded0forbothdummyregressors,sobluecollarservesasacategorytowhichtheotheroccupa-tionalcategoriesarecompared.2010byJohnFoxYorkSPIDA Dummy-VariableRegression ï¡ï«ï§ï¡ï«ï§Figure4.Theadditivedummy-regressionmodelshowingthreeparallelregressionplanes.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionThechoiceofabaselinecategoryisusuallyarbitrary,forwewouldtthesamethreeregressionplanesregardlessofwhichofthethreecategoriesisselectedforthisrole.Becausethechoiceofbaselineisarbitrary,wewanttotestthenullhypothesisofnopartialeffectofoccupationaltype,buttheindividualhypothesesareoflessThehypothesiscanbetestedbytheincremental-sum-of-squaresapproach,removingfromthemodel.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionForapolytomousexplanatoryvariablewithcategories,wecodedummyregressors.Onesimpleschemeistoselecttherstcategoryasthebaseline,andtocodewhenobservationfallsincategory,and0otherwise,forCategory 23 1 2 ··· ········· Totestthehypothesisthattheeffectsofaqualitativeexplanatoryvariablearenil,deleteitsdummyregressorsfromthemodelandcomputeanincremental2010byJohnFoxYorkSPIDA Dummy-VariableRegression4.ModelingInteractionsTwoexplanatoryvariablesinteractindeterminingaresponsevariablewhenthepartialeffectofonedependsonthevalueoftheother.Additivemodelsspecifytheabsenceofinteractions.Iftheregressionsindifferentcategoriesofaqualitativeexplanatoryvariablearenotparallel,thenthequalitativeexplanatoryvariableinteractswithoneormoreofthequantitativeexplanatoryvariables.Thedummy-regressionmodelcanbemodiedtoreectinteractions.ConsiderthehypotheticaldatainFigure5(andcontrasttheseexampleswiththoseshowninFigure1,wheretheeffectsofgenderandeducationwereadditive):In(a),genderandeducationareindependent,sincewomenandmenhaveidenticaleducationdistributions.In(b),genderandeducationarerelated,sincewomen,onaverage,havehigherlevelsofeducationthanmen.2010byJohnFoxYorkSPIDA Dummy-VariableRegression (a)EducationIncome MenWomen (b)EducationIncome MenWomenFigure5.Inbothcases,genderandeducationinteractindeterminingincome.In(a)genderandeducationareindependent;in(b)womenonaveragehavemoreeducationthanmen.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionInboth(a)and(b),thewithin-genderregressionsofincomeoneducationarenotparalleltheslopeformenislargerthantheslopeforwomen.Becausetheeffectofeducationvariesbygender,educationandgenderinteractinaffectingincome.Itisalsothecasethattheeffectofgendervariesbyeducation.Be-causetheregressionsarenotparallel,therelativeincomeadvantageofmenchangeswitheducation.Interactionisasymmetricconcepttheeffectofeducationvariesbygender,andtheeffectofgendervariesbyeducation.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionTheseexamplesillustrateanotherimportantpoint:Interactioncorrelationofexplanatoryvariablesareempiricallyandlogicallydistinctphenomena.Twoexplanatoryvariablescaninteractwhetherornottheyarerelatedtoone-anotherstatistically.Interactionreferstothemannerinwhichexplanatoryvariablescombinetoaffectaresponsevariable,nottotherelationshipbetweentheexplanatoryvariablesthemselves.2010byJohnFoxYorkSPIDA Dummy-VariableRegression4.1ConstructingInteractionRegressorsWecouldmodelthedataintheexamplebyttingseparateregressionsofincomeoneducationforwomenandmen.Acombinedmodelfacilitatesatestofthegender-by-educationinteraction,however.Aproperlyformulateduniedmodelthatpermitsdifferentinterceptsandslopesinthetwogroupsproducesthesamettothedataasseparateregressions.Thefollowingmodelaccommodatesdifferentinterceptsandslopesforwomenandmen:Alongwiththedummyregressorforgenderandthequantitativeregressorforeducation,Ihaveintroducedtheinteractionregressor2010byJohnFoxYorkSPIDA Dummy-VariableRegressionTheinteractionregressoristheoftheothertworegressors:isafunctionof,butitisnotalinearfunction,avoidingperfectcollinearity.Forwomen,(0)+0)+andformen,(1)+1)+TheseregressionequationsaregraphedinFigure6:aretheinterceptandslopefortheregressionofincomeoneducationamongwomen.givesthedifferenceininterceptsbetweenthemaleandfemalegroupsgivesthedifferenceinslopesbetweenthetwogroups.2010byJohnFoxYorkSPIDA Dummy-VariableRegression ï¡ï«ï§ï¢ï«ï¤Figure6.Theparametersinthedummy-regressionmodelwithinteraction.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionTotestforinteraction,wecantestthehypothesisIntheadditive,no-interactionmodel,representedtheuniquepartialeffectofgender,whilethesloperepresentedtheuniquepartialeffectofeducation.Intheinteractionmodel,isnolongerinterpretableastheunqualiincomedifferencebetweenmenandwomenofequaleducationisnowtheincomedifferenceatLikewise,intheinteractionmodel,isnottheunqualiedpartialeffectofeducation,butrathertheeffectofeducationamongwomen.Theeffectofeducationamongmen()doesnotappeardirectlyinthemodel.Extensiontopolytomousfactorsisstraight-forward.2010byJohnFoxYorkSPIDA Dummy-VariableRegression5.ThePrincipleofMarginalityTheseparatepartialeffects,ormaineffects,ofeducationandgenderaremarginaltotheeducation-by-genderinteraction.Ingeneral,weneithertestnorinterpretmaineffectsofexplanatoryvariablesthatinteract.Ifwecanruleoutinteractioneitherontheoreticalorempiricalgrounds,thenwecanproceedtotest,estimate,andinterpretmaineffects.ItdoesnotgenerallymakesensetospecifyandtmodelsthatincludeinteractionregressorsbutthatdeletemaineffectsthataremarginaltoSuchmodelswhichviolatetheprincipleofmarginalityareinterpretable,buttheyarenotbroadlyapplicable.2010byJohnFoxYorkSPIDA Dummy-VariableRegressionConsiderthemodelAsshowninFigure7(a),thismodeldescribesregressionlinesforwomenandmenthathavethesameinterceptbut(potentially)differentslopes,aspecicationthatispeculiarandofnosubstantiveinterest.Similarly,themodelgraphedinFigure7(b),constrainstheslopeforwomento0,whichisneedlesslyrestrictive.2010byJohnFoxYorkSPIDA Dummy-VariableRegression XY011=1D=0(b) Figure7.Twomodelsthatviolatetheprincipleofmarginality,byincludingtheinteractionregressorbut(a)omittingor(b)omitting2010byJohnFoxYorkSPIDA York SPIDA John Fox