From | Richard Williams <[email protected]> |
To | [email protected], <[email protected]> |
Subject | Re: st: Transformations |
Date | Tue, 10 Feb 2004 20:53:14 -0500 |
At 11:43 AM 2/11/2004 +1100, Jason Payne wrote:
Dear STATAlistserversStata does things kind of backwards from SPSS:
I am trying to transform data in variables. What is the equivalent STATA syntax for this SPSS command
if (var1=2) var2=1.
This syntax only works if you want to create a new variable, however in some cases I might with to modify an existing variable for one case only. This is particularly useful in cleaning string variables where there are spelling mistakes. In SPSS I would just type:replace stringvar="SPSS" in 1
if (caseid=1) stringvar='SPSS'.
if (caseid=2) stringvar='STATA'.
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |