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
Is there any function to compute cosine similarity scoreI would like to compute cosine similarity score by using Term Frequency-Inverse Document Frequency (…
Is there a way (portable between operating environments) for accessing file attributes in Stata?Hello All. The following has been bugging me ((based on my extensive experience of creating webs pag…
Matching within strata with PSMatch2Hello, I am implementing the following routine found in psmath2 help file because I have few variab…
Percentage change using a baseHi, I have a panel with items and prices. I have one group of items that belongs to one geographical…
Help on textfindWhen I use textfind with my following hypothetic dataset Code: textfind text_strings, key(RA) tfidf…
Subscribe to:
Post Comments (Atom)
0 Response to How to breakdown a complex variable into categories
Post a Comment