The SAS Output Delivery System and reporting techniques

Scientific notation

Reply
N/A
Posts: 1

Scientific notation

Hi,

I've been trying to use the ODS without any luck in trying to get something printed in scientific notation. I'm using the PROC MIXED to do some regressions and I would like the p-value (ProbF) from the Tests3 table printed as scientific notation instead of <.0001.

I just can't seem to figure out how to use the PROC TEMPLATE and ODS commands in the proper order to generate the output I need. I'm just going to post a small snippet of code I have and hope that someone could point me in the right direction.

Thanks,
Tony

--------------

OPTIONS nocenter nodate;
PROC template;
edit Stat.Mixed.Tests3;
edit ProbF; format=E12.; end;
end;
run;

DATA ILMN_10002;
INPUT @1 rs11152550 $2. @4 rs2228431 $2. @7 rs3747393 $2. @10 rs3747394 $2. @13 rs5939319 $2. @16 rs5982868 $2. @19 rs5982926 $2. @22 score 15.13 @38 sample $3. @42 sex $1. @44 year $4. @49 treatment $4. ;
DATALINES;
GG AA TT AA GG TT GG 9.180736541748 506 1 1981 dex
AA AA CC GG GG TT GG 9.238666534424 507 1 1949 dex
GG AA TT AA GG CC GG 8.720795313517 508 1 1946 dex
GG AA TT AA GG TT GG 10.428975741069 509 2 1938 dex
etc ....
;

ODS listing close;
PROC MIXED DATA=ILMN_10002;
CLASS sample rs11152550 treatment;
MODEL score=rs11152550 treatment ;
REPEATED treatment / SUBJECT=sample TYPE=CS;
lsmeans rs11152550 ;
ods output Tests3 = tata;
run;
ODS listing;
proc print data=tata;
run;
SAS Super FREQ
Posts: 8,864

Re: Scientific notation

Hi:
I think you may be editing the wrong template. It looks like Stat.Mixed.Test3 has this parent statement -- parent = Stat.Mixed.FTests; So, if you go look in Stat.Mixed.Test3, there is no ProbF column for you to edit...I'm guessing that your table template just ignores the edit statement for a column that it can't find in Stat.Mixed.Test3.

If you look inside the parent template, you do find a column for ProbF. So when I used the BP data set from a PROC MIXED example with THIS template definition (change Stat.Mixed.FTests and then change Stat.Mixed.Test3), I get the E notation used for the PROC MIXED results:

[pre]

ods path work.templ(update)
sashelp.tmplmst(read);

PROC template;
edit stat.mixed.ftests;
edit ProbF;
format=E12.;
end;
end;

edit Stat.Mixed.Tests3;
parent = Stat.Mixed.FTests;
end;
run;

ods select tests3;
/*---Model 1, general linear model with clinics assumed to be
a fixed effect---*/
proc mixed data=bp;
class trt visit complier clinic stratum;
model sbp = sbpbl trt
visit trt*visit
complier trt*complier
clinic trt*clinic
stratum trt*stratum;
repeated visit / type=vc sub=person;
run;

[/pre]

The results are:
[pre]
The Mixed Procedure

Type 3 Tests of Fixed Effects

Num Den
Effect DF DF F Value Pr > F

sbpbl 1 14 30.55 7.45540E-05
trt 1 14 0.22 6.47256E-01
visit 2 48 1.02 3.69462E-01
trt*visit 2 48 0.09 9.13313E-01
complier 1 14 7.83 1.42118E-02
trt*complier 1 14 2.98 1.06204E-01
clinic 3 14 8.88 1.51309E-03
trt*clinic 3 14 2.28 1.24106E-01
stratum 1 14 4.10 6.22769E-02
trt*stratum 1 14 1.25 2.82631E-01

[/pre]

What you'll find is that if you look in WORK.TEMPL template store, you'll have the parent template and the child template. Now, when you run your PROC MIXED, the change has been made to PROBF in the parent and so the child that's used for PROC MIXED had the E notation.

To return the ODS path to the usual PROC MIXED table templates, you would have:
[pre]
ods path sashelp.tmplmst(read);
[/pre]

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 409 views
  • 0 likes
  • 2 in conversation