BookmarkSubscribeRSS Feed
BRT001
Calcite | Level 5

Hi,

 

I am running a statistical analysis using the proc univariate (proc uni) function and to format the proc uni variable, I used the percent function percentn.n.  It worked for just the first variable but not for the others.  I was wondering if there is a special/different function for formatting proc uni variables as a percent?

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16
I believe you need to apply the format to the variables in the separate dataset with the existing dataset created by the proc univariate
Thanks,
Jag
Rick_SAS
SAS Super FREQ

Please show the statements that you are using. PROC UNIVARIATE ignores formats except for CLASS variables and for the display of INSET statistics.

BRT001
Calcite | Level 5

Hi, 

 

Here is an example of the statements I am using (the percentages work for the output but not for the results):

 

 

PROC SQL;

CREATE TABLE SET100 AS SELECT DISTINCT

A.YRY,

A.MTM,

A.ID,

A.RES,

A.PRES,

(PRES * MoDays*24) as total_month,

A.DRES/calculated total_month  format percentn10.2 AS PTRES

 

FROM SET00 A

 

WHERE A.CRES>0 AND A.DRES>0

order by calculated ptres desc;

QUIT;

 

proc univariate data=SET100;

var PTRES;

run;

ODS RTF CLOSE;

Ksharp
Super User

A.DRES/calculated total_month  AS PTRES   format=percentn10.2

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2685 views
  • 0 likes
  • 4 in conversation