Hi, I am new to STATA and am trying to combine multiple datasets which have multiple obs for multiple IDs (health data). I am working on combining the first 2 datasets, realising I should use the command -append-, but the r106 error generates. After further investigation there is one variable "mode_of_separation" which is byte in my "master dataset" with numeric values of (1-11) but string in the other dataset "deathdataset" with words (death on arrival).
The issue I have is that the 2 datasets should combine using the same variable "mode_of_separation" . I have a data dictionary so I know what the string values of the variable in deathdataset should be.
Eg: "Dead on Arrival" in Deathdataset is equal to 8 on the masterdataset
Although there will be 2 new values that need to be added (hence, the append command).
"Death with Autopsy" = 14
"Death without Autopsy" = 15
Wondering if there is a simple way to fix this, so the 2 datasets can be -appended- and the error with the "mode_of_separation" variable fixed to be made to be consistent in a byte format?
Due to confidentiality of my data I will refrain from using Dataex
Any suggestions would be greatly appreciated.
Related Posts with appending datasets receive r106 error - need to convert string vars to byte vars
Invalid name error in Stata simulation syntaxHi everyone I'm doing a simulation study following Adkins & Gade (p.26-27) and can't figure out…
What's the rationale behind egen_inequality excluding zeros?I'm using the user-written egen_inequal to compute Gini coefficients. Like so: Code: egen land_gi…
Insignificant year dummiesHi all, I am running a regression for my dissertation and was planning on including year dummies. T…
How to list observations excluding one variable?Hi everyone, I am doing an assignment and I'm stuck at one point. I have to list the first 8 observ…
Help with xtabond2 and xtdpdsysDear Statalist, I already searched for this topic and found similar threads, but I still have probl…
Subscribe to:
Post Comments (Atom)
0 Response to appending datasets receive r106 error - need to convert string vars to byte vars
Post a Comment