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.
Identify neighboring counties for treatment year and subsequent 2 yearsDear Stata users, I am working on a dataset of firms located in US counties for the years 2000-2018 …
Count unique observations by grouping vars if conditions is metHi I want to count the number of unique ID's per year and group. I have managed that with the follo…
asdoc + xtdidregress not workingHi Statalists! I wonder if someone else have a problem using asdoc together with the new xtdidregre…
How to draw 1:2 matched dataset then double the cases?Hello Statalists, Part of my data is as follows: Code: * Example generated by -dataex-. For more i…
Problem with implementing forward and backward linkages on stataHello, I am currently doing a research on FDI spillovers, at this point i need some help with imple…
Subscribe to:
Post Comments (Atom)
0 Response to String variable to numeric variable, -encode- command generates new values.
Post a Comment