BookmarkSubscribeRSS Feed
Tony
Calcite | Level 5
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;
1 REPLY 1
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1274 views
  • 0 likes
  • 2 in conversation