Hello,
I have 'data1' which is the original data. 'data3' is the output which I would like to have.
In data1 I would like to split CRI and mets.
CRI to CRI_1, CRI_2, CRI_3, CRI_4, CRI_5 and CRI_other
If CRI has 1, CRI_1 will be 1, else 0
Similarly, I want to split mets into mets_0001 mets_brain mets_lymph_node mets_lung
If mets is no, No, or ‘’ then mets_0001=0, else 1
If you look at mets, we have brain, lymph node, lung
So, if mets has brain in it, then mets_brain=1, else 0
data1 and data3 are attached.
Thank you so much!
Can you show what you tried? Also can you just post simple example input/output datasets as data step code instead of as binary dataset files?
It is not clear what is your grouping variable. Or how you are assigning values of CRI to a specific one of the many new varaibles. Are you just doing it by the order they appear? Or is there some additional variable with values like 1,2,3,4 that tell which target variable name to use?
Look at the %TRANSPOSE macro
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.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.