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.
Using substring functions in Stata 16.1Dear Statalist, I have a string variable "comment" stored as "strL" that contains a mix of numbers…
Graphing Medians Panel DataHello, I'd like to graph the median values of a variable. The data I have looks like this, and I wou…
Adding fixed effects in esttab using estaddHi all, I've run a few regressions and am trying to add rows indicating the presence of fixed effec…
re-formulate a functionHello everyone, I have this equation Code: g=exp(1.546776)*(x/(1-x)^(0.4314782)*y^(1-0.4314782)-exp…
Interpreting stata output with log dependent variable and % independent variablesHello stata users, Hope you are doing well. I have a question regarding interpreting stata output i…
Subscribe to:
Post Comments (Atom)
0 Response to String variable to numeric variable, -encode- command generates new values.
Post a Comment