SAS, by default yields percent, CI etc. to 4 decimal places. I'd like it to give me all results rounded to 5 decimal places.
My statement is as follows, can someone please help me figure out how I modify this statement to get everything in 5 decimal places?
proc surveyfreq data = stats2;
STRATA VESTR;
CLUSTER VEREP;
WEIGHT NW_WGHT;
tables PSYYR2 ANLYR TRQYR STMYR SEDYR/row cl (type = logit);
run;
Thanks,
Kiran
@kgrover wrote:
SAS, by default yields percent, CI etc. to 4 decimal places. I'd like it to give me all results rounded to 5 decimal places.
My statement is as follows, can someone please help me figure out how I modify this statement to get everything in 5 decimal places?
proc surveyfreq data = stats2;
STRATA VESTR;
CLUSTER VEREP;
WEIGHT NW_WGHT;
tables PSYYR2 ANLYR TRQYR STMYR SEDYR/row cl (type = logit);
run;
Thanks,
Kiran
Easiest is to send the data from your output to data sets using ODS OUTPUT and then Proc Print, or use in other procedures,where you can set the formats. Otherwise you have to manage custom templates and that can be a headache.
proc surveyfreq data = stats2; STRATA VESTR; CLUSTER VEREP; WEIGHT NW_WGHT; tables PSYYR2 ANLYR TRQYR STMYR SEDYR/row cl (type = logit); ods output oneway=MyOnewaydataset; run; Proc print data =MyOnewaydataset; format <your variable list> f10.5; run;
Your can either refer to the documentation to get the names of tables available with specific options or use ODS TRACE to list the tables used in the output.
ods trace on; proc surveyfreq data = stats2; STRATA VESTR; CLUSTER VEREP; WEIGHT NW_WGHT; tables PSYYR2 ANLYR TRQYR STMYR SEDYR/row cl (type = logit); run; ods trace off;
Will add information to the log about the tables used that can then be referenced in the ODS OUTPUT.
can this also be done using format?
@kgrover wrote:
can this also be done using format?
If you mean directly in the Proc output the answer is no for any of the statistics generated by the procedure. A format applied to a numeric value where used as a categorical variable should work but anything calculated such as confidence limits or percentages and such not in the survey procs yet.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.