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
Significance tests after statsby with sureg regressionDear all, I am doing an Event-Study with 649 firm announcements and estimate every announcement wit…
Cox regression with repeated measuresDear all, I am rather new to Cox regression models. I have a database with longitudinal observatio…
Pooled OLS with interaction on almost all explanatory variablesDear Statalist, I have panel data covering 763 firms over 15 years, taken from an industry consorti…
Creating an indexHello, I would like to create an index with several variables (high-tech exports in US$, no. of tech…
error r(198)Hi everyone, I am doing an event study analysis and when I use the estudy command, I get this error:…
Subscribe to:
Post Comments (Atom)
0 Response to How to breakdown a complex variable into categories
Post a Comment