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 on April 23, and its replacement, 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 <>
To   statalist <>
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–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index