[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Kit Baum <Baum@bc.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
re: st: Adjust after regression involving categorical variables |

Date |
Wed, 28 Oct 2009 10:37:55 -0400 |

<> Maarten suggested This is a case where you can meaningfully use "effect coding". This is a way of coding the categorical variable dummies so that they measure the effect relative to the overal mean rather than relative to the reference catogories. If you set the resulting dummies at zero you will get the adjusted prices for an average car. Effect coding is implemented in the -xi3- package by Michael Mitchell and Phil Ender. You can find it by typing in Stata -findit xi3-. *---------------- begin example ----------------- sysuse auto, clear xi3: regress price weight turn e.rep i.foreign adjust weight turn /// _Irep78_2=0 /// _Irep78_3=0 /// _Irep78_4=0 /// _Irep78_5=0 /// , by(foreign) *--------------- end example -------------------- Or much more easily as regress price weight turn i.rep78 i.foreign margins i.foreign, asbal

Model VCE : OLS Expression : Linear prediction, predict() at : rep78 (asbalanced) foreign (asbalanced) ------------------------------------------------------------------------------ | Delta-method

foreign |

------------------------------------------------------------------------------ Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html

An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**st: New -saveresults- package available from SSC** - Next by Date:
**Re: st: RE: RE: probability question** - Previous by thread:
**Re: st: Adjust after regression involving categorical variables** - Next by thread:
**st: probability question** - Index(es):

© Copyright 1996–2014 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |