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: Generate combined with if
From
Katia Bobulova <[email protected]>
To
statalist <[email protected]>
Subject
st: Generate combined with if
Date
Wed, 10 Aug 2011 15:48:09 +0100
Dear All,
I would like to construct this new price, given by the combination of
other prices when there is a particular id.
I typed:
by date: gen p=(price_b (if id==10) - price_b (if id==3))/ price_b (if id==3)
I also tried with if without the parenthesis, but I always receive
this error message:
price_bifid not found
Could you please help me?
Thanks,
Katia
*
* 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/