Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[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?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index