Is there a way to do the transposition below using PROC REPORT?
Hi, it depends on the structure of what you have. PROC REPORT will not directly "stack" 2 separate variables like NUMER and DENOM in 2 separate rows. So if NUMER and DENOM are diff variables, then the answer is yes, but with some data manipulation first. If NUMER and DENOM are both values of an ACROSS item, then it would be easier.
See the 2 transpose examples at the beginning of this paper. http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf
cynthia
Sorry, forgot the attachments.
Have:
Want:
Hi, it depends on the structure of what you have. PROC REPORT will not directly "stack" 2 separate variables like NUMER and DENOM in 2 separate rows. So if NUMER and DENOM are diff variables, then the answer is yes, but with some data manipulation first. If NUMER and DENOM are both values of an ACROSS item, then it would be easier.
See the 2 transpose examples at the beginning of this paper. http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf
cynthia
Thanks. I'm able to do it when I normalize the data first. There's not a (less easier) way to do it if NUMER and DENOM are two different variables?
Not with PROC REPORT. You'd have to try TABULATE or DATA Step program with 2 separate variables.
cynthia
I'm not going to retype your code to test but
proc tabulate data=have; /*your original data layout from the second post*/
class mc / missing;
var numer denom;
table (numer denom) * max=' '*f=best5. ,
mc='';
run;
might get close.
Warning: Proc tabulate does not have a display value approach, a statistic pretty much must be requested unless all you want is a count. The code I have will summarize. So probably will not yield desired result if there are duplicate values for MC.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.