Hi, could any one help me with the following two issues?
First, my id variable values start with 001, 002,... 011, 012, ... 099... and they are all coded as "string".
I thought I should convert them into "numeric" (please say no if this is not what I am supposed to do) and once I converted them, all zeros are gone.
How can I keep those zeros even when I convert them as numeric and is it really necessary or desirable to keep those zeros (since they are original id, so I think I should keep them)?
And second question is:
If some of group id variables start with alphabet (e.g. this household belongs to G35) as "string" variables, then can I just keep them as string or should I convert them something else that should work in Stata?
Sorry for bombarding many questions.
Thanks.
Related Posts with How to convert string id variable starting with "00" to numeric without losing the "00"?
What is the base category when two variables will interact with year dummy?Dear Stata User, I have one continuous independent variable (i.e., hhi), and other two variables d_n…
three dimension panel dataHi everybody I have a panel data with 3 variables: year, country and product. for each year I have 9…
Coding a variable according to the substring of many variablesHello everyone. I have 96 variables called moisx, where x takes values between 1 & 96. Each of …
Changing structure of Data setI have an excel data set in the format having first Column as Date, and following Columns have daily…
coefplot errorsHi guys! I have to do a replication project and still try to figure out what`s wrong with these com…
Subscribe to:
Post Comments (Atom)
0 Response to How to convert string id variable starting with "00" to numeric without losing the "00"?
Post a Comment