Hi folks,
I'd like to reconfigure and report the model output data in the form of a table shown below. Is it transpose problem or proc report problem? I'll appreciate your time and any suggestions. Direct help in the code would be helpful too.
DATA TRANS;
INPUT organs $ TYPE $ RR LCL UCL;
CARDS;
eye x1 1.05 1.04 1.06
eye x2 1.04 1.02 1.06
head x1 1.09 1.08 1.10
head x2 1.22 1.20 1.24
hand x1 1.42 1.40 1.44
hand x2 1.23 1.02 1.24
;
what i tried and didn't work is following:
PROC SORT DATA=TRANS ;
BY ORGANS;
PROC TRANSPOSE DATA=TRANS OUT=TRANS1;
BY ORGANS;
VAR TYPE;
RUN;
One way:
DATA TRANS; INPUT organs $ TYPE $ RR LCL UCL; CARDS; eye x1 1.05 1.04 1.06 eye x2 1.04 1.02 1.06 head x1 1.09 1.08 1.10 head x2 1.22 1.20 1.24 hand x1 1.42 1.40 1.44 hand x2 1.23 1.02 1.24 ; run; PROC SORT DATA=TRANS ; BY ORGANS; run; proc report data=trans; columns organs type,(rr lcl ucl); define organs /group; define type /across; run;
Your proc transpose code doesn't do anything with the rr lcl ucl so get discarded. I'm not quite sure what you were attempting with transpose. It won't create data sets with other variables nested within so you would still need to come up with something to display.
One way:
DATA TRANS; INPUT organs $ TYPE $ RR LCL UCL; CARDS; eye x1 1.05 1.04 1.06 eye x2 1.04 1.02 1.06 head x1 1.09 1.08 1.10 head x2 1.22 1.20 1.24 hand x1 1.42 1.40 1.44 hand x2 1.23 1.02 1.24 ; run; PROC SORT DATA=TRANS ; BY ORGANS; run; proc report data=trans; columns organs type,(rr lcl ucl); define organs /group; define type /across; run;
Your proc transpose code doesn't do anything with the rr lcl ucl so get discarded. I'm not quite sure what you were attempting with transpose. It won't create data sets with other variables nested within so you would still need to come up with something to display.
" Is it transpose problem or proc report problem?"
Do you want the output as dataset or report?
Well, in that case, no better than @ballardw 's sound help.
It's amazing to have you all for support. How many creative projects would not have been born had you not been there for help? I really appreciate you guys! Real, applied knowledge is helping others to learn and keep motivated in their creativity.
Likewise I learn a lot from your threads. Keep the questions coming! Have fun!
You can also try PROC TABULATE,
proc tabulate data=work.have;
var rr lcl ucl;
class organs / order=unformatted missing;
class type / order=unformatted missing;
table organs,
type=' '*(rr*sum="" lcl*sum="" ucl*sum="");
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: