|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Changing neg into pos values
You may just use
generate var2=100-var1
when var1 >0 this will give a value<100 as you want
when var2<0 this will give a value>100 as you want
Krishanu
On 2/25/08, Ziad El-Khatib <[email protected]> wrote:
> Dear STATAlister,
> i have variable var1 containing both of pos or neg values, i want to
> create new variable var2 equal to var1:
> to have var2=100-var1 if var1 >0
> to have var2=100 plus the positive value of var1 if var1<0 (for
> example if var1= -4 then var2 would be = 100 + 4 = 104
>
> any tips?
>
>
> Thank you in advance and best regards
> ziad
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
--
Read it: http://www.stata.com/support/faqs/res/statalist.html
Specially Question 3.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/