13 Stata tip 108 On adding and constraining Maarten L Buis Department of Sociology Tubingen University Tubingen Germany maartenbuisunituebingende In many estimation commands one can use constraint to impose linear con straints The most common of th ID: 70893
Download Pdf The PPT/PDF document "The Stata Journal yyyy vv Number ii p..." 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.
TheStataJournal(yyyy)vv,Numberii,pp.1{3 1.Theseareoddsratios,sothesignisdeterminedbywhethertheratioislargerorsmallerthan1.c yyyyStataCorpLPst0001 2Statatip108.usegss10.dta,clear(extractfromthe2010GeneralSocialSurvey)..genbytecongov=confed+conlegis+conjudge(463missingvaluesgenerated)..quilogitobamacongov,ornolog.eststoresum1..constraint1confed=conlegis.constraint2confed=conjudge..quilogitobamaconfedconlegisconjudge,orconstraint(12)nolog.eststoreconstr1..quilogitobamaconfedconlegisconjudge,ornolog.eststoreunconstr1..esttabsum1constr1unconstr1,stats(llN)eform///b(%9.3g)se(%9.3g)stfmt(%9.4g) Variable sum1constr1unconstr1 congov 1.62 .11confed 1.623.47 .11.576conlegis 1.621.69 .11.305conjudge 1.62.674 .11.107_cons .461.461.689 .0833.0833.134 ll -347.8-347.8-324.9N 557557557 legend:b/se..lrtestunconstr1constr1Likelihood-ratiotestLRchi2(2)=45.77(Assumption:constr1nestedinunconstr1)Probchi2=0.0000Anothersituationwherethischaracteristiccanbeusefuloccurswhenonehastwoormoreordinalorcategoricalvariablesthatonewantstocombine.Considertheexamplebelow.InthatexampleIwanttotreateducationasaordinalvariable,andIwanttoseetheeectof`familyeducationalbackground'ontheeducationalattainmentofthechildren.Ithinkof`familyeducationalbackground'assomesortofsumofthefather'sandmother'seducation,buthowdoIcreateasumoftwoordinalvariables?Thatishard,butitiseasytoconsidertheequivalentmodelthatconstrainstheeectsoffather'seducationtobeequaltotheeectsofmother'seducation.Inthisexampletheeects M.L.Buis3ofmother'sandfather'seducationarefairlysimilar,andthetestofthehypothesisthattheyareequalcannotberejected(compareunconstr2withconstr2).Italsoshowsthatconstrainingeectstobethesameisequivalenttoaddingthesumsoftheindicatorvariables(compareconstr2withsum2)..quiologitdegreei.madegi.padeg,ornolog.eststoreunconstr2..constraint11.madeg=1.padeg.constraint22.madeg=2.padeg..quiologitdegreei.madegi.padeg,orconstraint(12)nolog.eststoreconstr2..genbytep_hs=1.madeg+1.padeg(329missingvaluesgenerated).genbytep_mths=2.madeg+2.padeg(329missingvaluesgenerated)..quiologitdegreep_hsp_mths,ornolog.eststoresum2..esttabunconstr2constr2sum2,stats(llN)eform///b(%9.3g)se(%9.3g)stfmt(%9.4g)keep(degree:) Variable unconstr2constr2sum2 madeg 1 2.52.17 .449.1992 4.895.51 1.26.691 padeg 1 1.882.17 .322.1992 6.085.51 1.46.691 p_hs 2.17 .199p_mths 5.51 .691 ll -799.1-800.5-800.5N 972972972 legend:b/se..lrtestunconstr2constr2Likelihood-ratiotestLRchi2(2)=2.79(Assumption:constr2nestedinunconstr2)Probchi2=0.2484