BookmarkSubscribeRSS Feed
tarheel13
Rhodochrosite | Level 12

What is the best way to count AEs? I can't count any duplicates per subject in SOC and PT. Need to get max severity and closest relatedness (related to study drug or not related to study drug). Currently, I just make some occurrence flags and sum them in proc SQL get the n and percent from doing that and go through proc transpose and proc report. If someone knows a better way, I'm curious. 

5 REPLIES 5
Aku
Obsidian | Level 7 Aku
Obsidian | Level 7

This is not actually SAS related question, but you can get rid off some duplicates if you are using AEGRPID variable to group fluctuating AE's as with one Group ID. You can find more information from CDISC website.

tarheel13
Rhodochrosite | Level 12

I disagree. I think it is SAS-related seeing how I use SAS to make AE summary tables. I don't have AEGRPID variable either. 

Reeza
Super User
PROC SQL distinct count is what I used to use or double PROC FREQ.
It depends on how you store your data as well and code things which isn't always standardized.
tarheel13
Rhodochrosite | Level 12

lrackley_0-1610990428276.png

@Reeza do I have to do several different proc freqs to get this though? I have a top row for Any SOC Any PT and then I have SOC Any PT and then the rows under that SOC would be the PTs within that SOC. Cannot count duplicates in SOC and PT. If there is a duplicate, it has to be only the one with max severity and max relatedness. 

Reeza
Super User
PROC TABULATE would do a table in that structure, not freq. Neither do distinct count as a specific measure, you'd still need at least one more step to handle that.

Personally, I keep my data processing separate from the reporting/display layer and pre-calculate similar to what you do. This way the display layer is separated and can be re-used more easily IMO.

Roland used to maintain a good set of reporting utilities and macros here:
http://www.datasavantconsulting.com/roland/Spectre/index.html
He's deceased, so no support or updates but there are some good references there and an entire clinical reporting system in many ways.

And there's the SAS Clinical Reporting package itself which should help with some of this.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 5 replies
  • 2811 views
  • 0 likes
  • 3 in conversation