Hi,
I want to generate a variable based on two existing variables.
I have two variables : govshr and prishr and the variable I need is to take the value of govshr or prish whichever is greater.
I tried the following but the result is not what I want
1. gen right=0
2. replace right=govshr if govshr>prishr
3. replace right=prishr if prishr>govshr
What happend it, stata takes both commands (2 & 3) separately so I end up with the results of either (2) or (1). Any help will be highly appreciated.
Regards
David
--
David Ashcraft
PhD candidate
Bangor University
UK
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/