Good evening experts,
I was wondering if any of you could please assist me with the following:
I have two different variables "Bacterial_species" and "virus". "Bacterial_species" has four categories which are bact2, bact3, bact5, bact6. While "Virus" has two categories ("yes" "No" & "Unknown"). I have combined the two variables because I would like to see the number of patients who have had co-infections. I used the following code:
egen coinfection = group(bacterial_species virus), missing label lname(coinfect) truncate(3)
label var coinfection "Bacterial confection with virus"
tab coinfection, missing
As a result, I was able to see the number of people who had a specific bacterial species and virus co-infection, who didn't, and the unknowns (see attached pic).
However, I would like to re-arrange these categories into four. 1)bact3 or/and bact5 coinfection with virus 2)bact2 or/and bact6 coinfection with virus 3)No Co-infection 4) Unknown
Any assistance would be extremely helpful! Thank you very much in advance!
Related Posts with How to breakdown a complex variable into categories
Stop dofile if drop did not make changeDear Statalists, for error-checking in many replace commands, I have found it useful to use the pro…
Value ReplacementDear all, I am quite new with stata, and after a couple of days trying to fix a problem without any…
Wilcoxon test for (in)equality of mediansHello everyone, For my univariate analyses I am running a number one-sample t-tests. However, I woul…
Origin Dest Airline DataMy airline data looks like this: input str3(origin dest) str41 unique_carrier_name int departures_p…
Regressions with interaction terms and interacted fixed effectsHi, i've got some questions about how to run a regression with interactions especially how to deal w…
Subscribe to:
Post Comments (Atom)
0 Response to How to breakdown a complex variable into categories
Post a Comment