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.
Help needed in loopsHi all, I am using Stata 17 and would need some help in my loops. Below is an example of my dataset…
Creating a categorical variable with multiple dummy variablesHello everyone, I am looking for a way to create one categorical variable out of multiple dummy var…
Generalise value of dummy variable to all observations of a given panel IDHi, I need to set the value of a dummy variable = 1 for all observations of a given panelID, if it …
ForecastingI have been using STATA to do some forecasting on stock market data. When I generate the forecasts a…
No observations r(2000)Dear everyone, I am working on my masters thesis and I am trying to make a twostep system gmm regre…
Subscribe to:
Post Comments (Atom)
0 Response to String variable to numeric variable, -encode- command generates new values.
Post a Comment