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
Dummy VariableHi, So I created a dummy variable by the following code: gen YearGroup = 0 replace YearGroup = 1 i…
Predictive Modeling using StataAny in depth books or tutorials on modeling with Stata that might be recommended? …
Converting data to numericHi All, I have the following dataset: Code: * Example generated by -dataex-. To install: ssc ins…
Stata commmands to analyze data where each record contains monthly totals: aggregate data problem but not really a wide to long solutionHi, I have some health centre data from Africa where each record consists of fields that represent …
How to handle missing data?Hi all, I am investigating health disparities in some Sub-Saharan Africa countries. Ethnicity is one…
Subscribe to:
Post Comments (Atom)
0 Response to appending datasets receive r106 error - need to convert string vars to byte vars
Post a Comment