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
Struggling to create this variableHi! For my thesis, I'm interested in the effect of a change in working hours on mental health outco…
How to count the number of the multiple observations into the same group onceHi all, I just a beginner using STATA and I need an help to solve a problem that probably seems simp…
Interaction with running variableIn my panel data set analysis, I interact the treatment variable with the running variable to see wh…
Placebo TestHello, i am trying to run a placebo test with the synth command downloaded from the homepage of Jen…
Problem with fixed effect in cross sectional dataHello everyone, I am doing research about racial discrimination in mortgage interest. Many resear…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with Gen & string/numeric variable conversion
Post a Comment