BookmarkSubscribeRSS Feed
Angela
Calcite | Level 5

Hi, I need to know how to add median , first quartile to the third quartile on the second line of the report;

this is my script:

proc format;

value RAN_TO_AP 2='Octreotide' 1='Soma' ;

run;

ods listing close;

ods ESCAPECHAR = '!';

ods rtf file="&path.rtf" style=statsinrows;

proc report data=aladin nowd ;

column  Parameter RAN_TO_AP, (('Baseline' map_v1=h map_v1=hsd map_v1=hm)('treatment' map_v7=w map_v7=wsd map_v7=wm)('Recovery' map_24f_270415=m map_24f_270415=msd map_24f_270415=mm) );

define RAN_TO_AP / across width=3;

define h /' ' analysis median style=[cellwidth=50 just=R borderrightstyle=hidden] format=2.1;

define hsd / ' ' analysis q1 style=[cellwidth=50 just=L borderleftstyle=hidden]f=paren.;

define hm / ' ' analysis q3 style=[cellwidth=50 just=L borderleftstyle=hidden]f=paren.;

define w /' ' analysis median style=[cellwidth=50 just=R borderrightstyle=hidden] format=2.1;

define wsd / ' ' analysis q1 style=[cellwidth=50 just=L borderleftstyle=hidden] f=paren.;

define wm / ' ' analysis q3 style=[cellwidth=50 just=L borderleftstyle=hidden]f=paren.;

define m /' ' analysis median style=[cellwidth=50 just=R borderrightstyle=hidden] format=2.1;

define msd / ' ' analysis q1 style=[cellwidth=50 just=L borderleftstyle=hidden] f=paren.;

define mm / ' ' analysis q3 style=[cellwidth=50 just=L borderleftstyle=hidden] f=paren.;

title1 'Table 1: Patients characteristics at randomization and at the end of treatment period  according to study treatment - overall';

run;

ods rtf close;

ods listing;

output


  Active Placebo

              baseline Treatment Recovery Baseline Treatment Recovery
Parameter 
Weight 103 (409.99) 1024 (426.97) 935 (345.12) 1016 (367.61) 1042 
Height 15 (28.06) 12 (17.15) 15 (57.30) 20 (61.99) 16 (77.52) 12 (15.18)





output i need it:+

         Active Placebo Baseline Treatment Recovery Baseline Treatment Recovery

Parameter

Weight      103 (409.99) 1024 (426.97) 935 (345.12) 1016 (367.61) 1042

            88 (75 to 107) 91 (73 to 97) 89 (83.3 to 100) 88 (75 to 107) 91

Height        15 (28.06) 12 (17.15) 15 (57.30) 20 (61.99) 16 (77.52) 12 (15.18)

              88 (75 to 107) 91 (73 to 97) 89 (83.3 to 100) 88 (75 to 107) 91

where in first line there is mEAN (STD) and the second line median (q1 to q3)

Thanks guysSmiley Happy

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi, you will have to restructure your data. PROC REPORT will only add another report row for WEIGHT and HEIGHT if you have an observation in the data. This may mean you need to use 1 procedure (like MEANS or TABULATE to calculate the statistics you want) and then restructure your DATA so that you can use PROC REPORT to get the final report the way you want.

cynthia

Angela
Calcite | Level 5

thanks for the reply !

I have several variables representing three different time : baseline, treatmente and recovery so I dont know how to change the dataset; the advice of the different procedures is appreciated,

thank you Cynthia

Cynthia_sas
SAS Super FREQ

Hi:

  Still not at a good computer for long posts, but this looks like a standard demographic type report. I had a paper back in 2008 called "Creating Complex Reports" that had 3 different examples of creating demographic reports similar to this. 2 of them used PROC REPORT and 1 of them used PROC TEMPLATE, DATA _NULL_ and a custom table template.

  I think if you go to support.sas.com/rnd/papers and search for the paper title for 2008, you should find the paper.

cynthia

Angela
Calcite | Level 5

Thank you Cynthia, my case is  Complex 8: Demographic Report Example, i found it  for you help!! I use proc TABULATE (for summary) and  TEMPLATE (for table template)

thank you very much, you are really kind

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1126 views
  • 0 likes
  • 2 in conversation