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
Sparse Matrix Capabilities in MataHello ! Are there any user written Mata Library packages for implementing sparse matrix and sparse m…
Specify Range in Propensity Score MatchingDear All, I am using propensity score matching to match observations in current year with observati…
twoway line graph with vertical lines that are conditional on third variable valueHi! I have panel data of mortality rate over time by state of the US as well as a dummy variable for…
Province and year fixed effectsHello altruists, I am new to this forum. I've been working on province and year fixed effects and ha…
Plot coefficients from Conjoint AnalysisHello Statalist, I want to plot the coefficients of a conjoint analysis like the graph I put before…
Subscribe to:
Post Comments (Atom)
0 Response to How to breakdown a complex variable into categories
Post a Comment