--- On Wed, 28/10/09, [email protected] wrote:
> I am struggling to understand the -adjust- command after
> regression involving categorical variables. My aim in using
> -adjust- is to obtain the predicted values adjusted for the
> categorical variable, but I am not explicitly interested in
> the categorical variable and so do not want it appearing in
> the -by()- option of -adjust-.
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 --------------------
( For more on how to use examples I sent to statalist see:
http://www.maartenbuis.nl/stata/exampleFAQ.html )
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/