Dear forum members,
I am new to Stata and having a problem that I can't seem to find a straightforward answer to. I'm dealing with a data set that has mix of many string and numeric variables. So when I do a code such as "gen X = Y-Z", I get a type mismatch error. So then I try to encode the string variable, it goes through without an error but the actual number in X is not correct (not actual Y-Z calculation outcome). It seems to be a constant problem whenever I use a variable created from "encode" command.
Could you please advise how to resolve this?
I appreciate your help.
Best,
Nathan
Related Posts with Problem with Gen & string/numeric variable conversion
VARNAME dialog elementDear All, While programming a dialog one can use an option numeric for the VARNAME dialog elements,…
Generating new variable from r-class command that produces multiple returns (as a result of using 'by:' command)Hello I would like some assistance with generating newvar [XIRR] from returned r-class command. I …
replacing data of two row in only one row.i have data like below Code: * Example generated by -dataex-. To install: ssc install dataex clear …
Pooled-Cross Sectional Data - nhis_alcohol.dtaHello, I am writing an Empirical Paper on the effect of alcohol on labor market outcomes. The data i…
Generating dummy based on company classificationHi everyone, I am looking to create a dummy variable based on another dummy variable for an identif…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with Gen & string/numeric variable conversion
Post a Comment