Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: coding of factor variables
From 
 
"Sun, Yan (IFPRI)" <[email protected]> 
To 
 
<[email protected]> 
Subject 
 
st: coding of factor variables 
Date 
 
Sat, 4 Jun 2011 17:03:30 -0400 
Hi,
Part I, when I have three groups, I create dummies for group1 and group2
(treating group3 as a base):
My equation is reg y x z group1 group2
I want to calculate: 
predict xb, xb
gen xbb1=xb-_b[group1]*group1-_b[group2]*group2
Part II, when I have 400 groups now
My equation now is: xi: reg y x z i.group
Predict xb, xb
How do I calculate xbb1? Could I write xbb1=xb-b[i.group]*i.group? Since
My problem is that I am not able write all of these 400 groups in the
code. 
Thank you very much.
Yan Sun
IFPRI
*
*   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/