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
Merging two data sets: weighting help?Hi All, I am working to merge two separate data sets, each with their own sampling method and weight…
New package -checkipaddresses- on SSC : identify IP addresses behind VPN/VPSThanks to Kit Baum, my checkipaddresses is available from SSC. checkipaddresses queries an IP addre…
2SLS estimationHello, I would like to estimate the following 2SLS panel regression: First stage: Zit = α Wit*Fit +…
Is there an arbitrary scaling factor in logistic regression in Stata?Hi, Norton et al state in a recent JAMA guide that the magnitude of the odds ratio from a logistic …
Interpretation of grand mean centered versus original form level-2 variables in multilevel logistic regressionHello, I have a random intercept multilevel logistic regression model with cross-level interactions…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with Gen & string/numeric variable conversion
Post a Comment