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
odksplit for ODK and SurveyCTODear all, I am happy to announce that odksplit is now available in ssc. odksplit is a module to spl…
How to make a point estimate in mixed model: the effect of group at a certain point of the slopeDear Stata users, I have a mixed model (see the syntax below) with main effects of group (two dicho…
Multinomial logistic regression - RRR is too bigHi, I am running a regression where a firm performance measure ( a categorical variable) is regress…
nbreg only converges when starting from poisson estimatesI am using nbreg (Stata MP 15.1) to analyze the rate of days on which patients use two different dru…
NIS database helpHi, I am realtively new to large database analysis and trying to work on the NIS 2011 database. Does…
Subscribe to:
Post Comments (Atom)
0 Response to Conditional conversion to string variable
Post a Comment