Hi all I have AE data which is structured like:
Arm Preferred_term
A Headache
A Zoster
B Fatigue
B Headache
I want to use proc freq to create a data set containing risk difference (comparing Arm A and Arm B) like this:
Arm Preferred_term Risk_diff
A Headache 0.45
A Zoster 0.5
B Fatigue 0.1
B Headache 0.2
How do I structure the data prior to using proc freq?
Thanks.
Relative risk and risk difference in Proc freq data structure would be basically one of two forms.
Summarized data would have a risk variable with two levels (had/did not have exposure or risk) outcome (did/did not have outcome) and a count of cases. The count variable would be used as WEIGHT variable in Proc Freq.
An example of this data appears in the Example section of Proc Freq in "Analysis of a 2x2 Contigency Table".
as:
data FatComp; input Exposure Response Count; label Response='Heart Disease'; datalines; 0 0 6 0 1 2 1 0 4 1 1 11 ;
The other structure would be person/case level data where each observation is one case and just has the Exposure and Response.
I might guess that your outcome or response is "have headache"/"do not have headache" "have zoster/do not have zoster".
I really hesitate to guess what your exposure or actual risk might be though. "Arm" sounds very unlikely to be a risk. So I suspect we are missing some details.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.
Ready to level-up your skills? Choose your own adventure.