I have a couple hundred thousand income observations within my data. However, when I tried to create buckets, an error message informed me that the variable was a string variable and not numeric (although the variables are numbers). Either way I searched for a work around and -encode- did destring the variables however, it recoded the underlying values to be different numeric values. For example, after using -encode-, although, the value says 40,009 (as average hh income) when you click the value you see that stata actually has coded it 396.
Has any one run into this before? Anyone know of a solution to ensure that 40,009 is the actually value stata reads so that I can make buckets that would be made up of 40000 - 50000, 50000 -60000, etc.
Related Posts with String variable to numeric variable, -encode- command generates new values.
How to reshape data from wide to long with multiple variables?Hi, I have two questions regarding data cleaning: Q1) I have a following wide data and want to conv…
Creating a new categorical variable by spousal agreement/disagreementHi, I'm trying to create a new categorical variable that indicates (heterosexual) spousal disagreeme…
How to reshape data from wide to long with "tricky" variable names and how to merge multiple data files?Hi, I have two questions regarding data cleaning: Q1) I have a following wide data and want to conv…
Alternatives to ratio of two count variables when there are zerosHello everybody, I apologize in advance for the lengthy post but I just want to provide some contex…
Doing Bayesian modelling in StataHello This is something that has puzzled me for a while but I haven't pursued it because I use rsta…
Subscribe to:
Post Comments (Atom)
0 Response to String variable to numeric variable, -encode- command generates new values.
Post a Comment