Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Generate combined with if


From   Katia Bobulova <katia.bobulova@googlemail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
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/


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