BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ansepans
Calcite | Level 5

Hi,

I have data on the bacterial compositions of skin swabs of 900 patients. I want to know if there is a difference in bacterial composition between males and females. I have stumbled upon compositional analysis but I don't know if it is the right way to do it and I don't know how to do it. Can any of you help me?

 

I have data that look like this:

 

female data set

sex sample count percent

1  CNS   511  63%

1  Gram-negative rods 63 8%

1  Gram-positive rods  63 8%

1  Micrococcus  127   16%

1  Other Gram-postive cocci  37 5%

1  Staphylococci   8  1%    

 

male data set

2 CNS   447  68%

2 Gram-negative rods 33  5%

2 Gram-positive rods 54 8%

2 Micrococcus  98  15%

2 Other Gram-positive cocci 18  3%

2 Staphylococci  5   1%

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
nicobuettner
SAS Employee

Hi,

 

just to maybe get things going: Can you specify what your desired outcome would be?

I have no idea of compositional analysis. My data-management-based approach would be to merge the datasets and just compare the male vs, female values with simple if statements or something.

 

Let me know if you need a code example for that should you need one.

 

Best,

Nico

View solution in original post

1 REPLY 1
nicobuettner
SAS Employee

Hi,

 

just to maybe get things going: Can you specify what your desired outcome would be?

I have no idea of compositional analysis. My data-management-based approach would be to merge the datasets and just compare the male vs, female values with simple if statements or something.

 

Let me know if you need a code example for that should you need one.

 

Best,

Nico

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 525 views
  • 0 likes
  • 2 in conversation