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
mata function available in different ado-filesDear all, I am trying to execute a mata function in different but related ado-files, but I don't kn…
Command to list households with multiple heads/without heads in a survey dataBelow is a extract data from a survey conducted for various households within a community, please wh…
svylogitgofHi! I am absolutely new to STATA and I hope that you could help me to solve this issue. I run a lo…
-gsem- for dynamic multinomial logit model with random effectsDear All, I am trying to analyse, using panel data, the extent of state dependance to a previous si…
Calculating citation half-lifeDear all, Assume that you have the following problem. You have patent citations for firms in differ…
Subscribe to:
Post Comments (Atom)
0 Response to How to breakdown a complex variable into categories
Post a Comment