11.10.07

Silly Proc Report !
Compiled by Soumya Gopinath

An annoying period (.) appeared in the p-value column when the break statement was applied in proc REPORT. How can we eliminate this period (.) from the report (rtf file)?

Solution:
Firstly, the data type of p-value variable is numeric then the break option will replace the missing values with a period. To avoid this situation change the data type of p-value variable to character. Then the missing values will be replaced by blank space only.
Eg:
/* Create dataset with 5 variables and 8 observations*/
data test;
input usubjid $ parameter $ visit $ trtgrp result;
datalines;
001 FEV1 VISIT1 1 2.34
002 FEV1 VISIT1 3 0.98
001 FEV1 VISIT4 1 2.04
002 FEV1 VISIT4 3 1.98
001 FVC VISIT1 1 2.34
002 FVC VISIT1 3 2.98
001 FVC VISIT4 1 2.44
002 FVC VISIT4 3 1.99
;
run;
/* Carrying out ANOVA*/
ods output ModelAnova= test1;
proc glm data=test;
by parameter visit;
class trtgrp;
model result=trtgrp/ss3;
lsmeans trtgrp/adjust=t pdiff;
run;

data test2;
set test1;
test=' '; /* dummy variable*/
keep parameter visit probf Test;
run;

/* Specify the output location*/

ods rtf file="D:\soumya\test.rtf" style=styles.listingstyle;

proc report data = test2 nowd spacing = 2 headline headskip split = '*' missing;
column parameter visit test,(probf);
define parameter / group order=data left 'Parameter' ;
define visit / display left 'Timepoint' ;
define Test / across center "Test" ;
define probf/ display left "p-value";
break after parameter/summarize suppress;
run;

ods _all_ close; /* Closing all ODS outputs statements*/

In the above example probf is a numeric variable within the across variable ‘test’. So in the output a period occurred when the break statement active. Eliminate this we add one more statement in the dataset Test2.
probf1=put (probf, pvalue6.); /* for converting numeric type to character*/

Generally we can say that the numeric variables within the across variable in REPORT procedure should make a period in the blank space and to avoid this convert numeric variables to character by using PUT function.



No comments: