Hi everyone, I have a problem when destring a variable into numeric. I have created my observations ID using the egen + concat function:
egen folionumeric = concat(cd_a ent est est_d con v_sel tipo mes_cal n_hog h_mud n_ren)
they are all numeric variables. So, what I get is a string that 'looks like' composed of numbers. Fine.
However, I need to declare my panel, so I need a numeric variable. Then what I did is:
destring folionumeric, replace
folionumeric: all characters numeric; replaced as double
Stata says that they were all numeric so everything looks fine. However, it seems that I have a different number of unique values between the pre-string variable and the destring variable. Do you have any idea of why this happen? here follows a screenshot of the description of the two variables.
The code is about 1 million observations, so I do not know how to inspect what happens without checking observation by observation.
Thank you very much.
egen folionumeric = concat(cd_a ent est est_d con v_sel tipo mes_cal n_hog h_mud n_ren)
they are all numeric variables. So, what I get is a string that 'looks like' composed of numbers. Fine.
However, I need to declare my panel, so I need a numeric variable. Then what I did is:
destring folionumeric, replace
folionumeric: all characters numeric; replaced as double
Stata says that they were all numeric so everything looks fine. However, it seems that I have a different number of unique values between the pre-string variable and the destring variable. Do you have any idea of why this happen? here follows a screenshot of the description of the two variables.
The code is about 1 million observations, so I do not know how to inspect what happens without checking observation by observation.
Thank you very much.
Comment