Hello,
I am Salvatore, happy to join the Stata Forum community.
I am a new user who recently started using Stata. For my thesis research, I am using panel data. At the time I imported this data on Stata all my variables has been converted to strings. Since my dataset consists of over 60 columns (due to the fact that I use six variables and 12 years-time period of 2021-2010), I would like to try to set up a loop that will allow me to convert all the strings to numbers without typing each code. Please help me and I will give every kind of information that would be helpful. The command I am trying to use is with foreach, but I don't know how to use it.
[foreach var...]
Thank you very much. Sorry for my mistakes in following the posting rules, but this is my first post and I am still learning. I apologize for not being able to use dataex, but Stata says "input statement exceeds linesize limit. Try specifying fewer variables" Hope you will understand.
Salvatore
Related Posts with create a loop to convert string variables in numeric variables
Tobit Model Decomposition (Probability of adoption for non-adopter group and Intensity of Participation for adopter group)I am working on adoption study with non-adopter category and non-adopter category. How can I decompo…
Tobit Model Decomposition (Marginal effects for probability of adoption and marginal effects for Intensity of adoption)I am working on adoption study with non-adopter category and non-adopter category. How can I decompo…
Obtain coefficients for cross-sectional regression by id monthlyDear Statalists, I like to run this cross-sectional regression for my panel data and obtain only th…
Regarding GMMHi, There are multiple commands (xtabond , xtabond2, xtdpdsys) for GMM in Stata. What is less clear…
How to decompose marginal effects of Tobit model in to probability and intensity using stata 14?Hello Dear all members of StataList; Can anyone help me on the command to decompose Tobit model in …
Subscribe to:
Post Comments (Atom)
0 Response to create a loop to convert string variables in numeric variables
Post a Comment