Hi, this is Alice.
I am constantly facing problems of destring a variable that contains both numerical and character context.
Question 1: How can I force the stata to import every variable in string not numeric?
Question 2 When importing variables that contain both numeric and text, I can only use encode. Destring will not work and gen var= real(var) will give me missing values
However, after encoding, the variable value was totally messed up by default.
How can I convert the string variable into numeric by its lab value?
Question 3 would be how can I filter variables by their lab value? as is " keep if var equal to " lable value"
I am sure there is an easy way, but my knowledge is very limited.
Please see attached screen shots for a better interpretation of my questions.
Thank you very much and looking forward your reply
Related Posts with encode and destring
Avoid truncation of axis labels in bar graphHi Statalist, I am trying to make a bar chart in Stata with some very long labels on the y-axis. Ho…
Table of countries in panel dataDear users, For my thesis, I am looking to export a table from Stata consisting of all the countrie…
Difference-if-Differences omitting variablesDear all, I have a large panel data set and I use diff-in-diff to analyze the effect of a parental …
Z-test for a portfolio and a benchmarkHello, I am trying to run a z-test on the mean of a variable of a portfolio (top 10 percent of an i…
Fixed effects, robust standard errors and clustered standard errorsHi, I'm making a difference-in-differences analysis with multiple interaction terms for returns - t…
Subscribe to:
Post Comments (Atom)
0 Response to encode and destring
Post a Comment