Dear all,
I have a question with regard to the code destring and encode.
In my regressions, I have “real” string variables that contain nonnumeric text (like country names or industries) and variables that are string variables, but that contain meaningful numeric text (like 5.2, 6.7, etc.). If I understand it right I have to use encode for the variables with nonnumeric text and destring for the variables with numeric text.
As I didn’t know the code destring, I converted all variables by using encode. My regressions work perfectly, but when I look at the descriptive statistic, the values of the variables with numeric text are wrong.
If I use destring for my numeric text variables and encode for the real string variables, I have two problems:
(1) nearly all observations are dropped because of collinearity in my OLS regression
(2) I get “no observations” for my IV regressions.
I don’t really understand these two problems as I don’t know who the two commands convert the variables. Is it possible to convert some of my variables with destring and others with encode within one dataset? And is there any possibility to solve my problems?
Thanks
Teresa
I have a question with regard to the code destring and encode.
In my regressions, I have “real” string variables that contain nonnumeric text (like country names or industries) and variables that are string variables, but that contain meaningful numeric text (like 5.2, 6.7, etc.). If I understand it right I have to use encode for the variables with nonnumeric text and destring for the variables with numeric text.
As I didn’t know the code destring, I converted all variables by using encode. My regressions work perfectly, but when I look at the descriptive statistic, the values of the variables with numeric text are wrong.
If I use destring for my numeric text variables and encode for the real string variables, I have two problems:
(1) nearly all observations are dropped because of collinearity in my OLS regression
(2) I get “no observations” for my IV regressions.
I don’t really understand these two problems as I don’t know who the two commands convert the variables. Is it possible to convert some of my variables with destring and others with encode within one dataset? And is there any possibility to solve my problems?
Thanks
Teresa
Comment