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
How to transform this kind of data to panel dataHi everyone, I have a dataset like follows, MMM US Equity MMM US Equity MMM US Equity ABBN SW Eq…
Propensity Sample Match with Fixed EffectsI am working on a large data set that includes observations from two different years (it's not a pan…
boottest: just as wild, 10X fasterAppendix A.2 of the paper about boottest describes an opportunity to speed up the program's construc…
Creating all matched pairs Code: clear all set obs 50 generate id1 = . replace id1 = 1 if _n > 0 & _n < 10 replace …
Durbin Wu Hausman TestHello, i am struggling with interpreting results from Durbin-Wu Hausman Test for Pooled OLS and fi…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with Gen & string/numeric variable conversion
Post a Comment