Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Changing neg into pos values


From   "Ziad El-Khatib" <Ziad.El-Khatib@ki.se>
To   statalist@hsphsun2.harvard.edu
Subject   st: Changing neg into pos values
Date   Sun, 24 Feb 2008 23:50:44 -0800

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/



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