Hello, I have a large dataset which I receive in 5 excel files. There is a variable, lets say X, this variable appears as double in some excel files and in others it appears as string. The problem is, they change everyday, for example, Excel 1 might contain X in double format one day and the next day, it might be string. Therefore, the code tostring X, gen(strX) format(%15.0f) does not always work. Is there a way to code this so that I don't have to change the programme every time? perhaps a conditional conversion?
Related Posts with Conditional conversion to string variable
Problem in using matched(merged) data in regression.I am new to STATA. I am working on DHS dataset. I have merged the men recode file with the individua…
Competing Risk ModelI have a problem, where I am using hazard model. Database includes around 100 firms that are/are not…
XTLOGIT - Panel data - Loan part Level Data (mortgages) > help regarding iterations by adding a variableDear all, Currently performing logistics analysis on my dataset. The dataset contains loan parts ov…
Panel data: generate yearly average variableHello there, I am currently working with a panel dataset, and am having trouble with an issue I hop…
Extract Specific Text Between ColonsGood afternoon, I am having trouble with this one today.... I need to extract to a new variable, a…
Subscribe to:
Post Comments (Atom)
0 Response to Conditional conversion to string variable
Post a Comment