BookmarkSubscribeRSS Feed
JuanVte
Calcite | Level 5
Dear all,

I am starting to use the Roland's library macros and I have a little problem.

For unistats macro, the parameter misspct says,

misspct=no By default, do not include missing category counts in the
percentage calculation. If set to "no" then p-values will
not be based on the missing category.


But, or I do not understand what it says or this parameter does not work.

The following macros produce the same percentages:

proc format;
value sex 1 = 'Male'
2 = 'Female';
value age 11-13 = 'Age group 1'
14-high = 'Age group 2';
run;

data class;
set sashelp.class;
if sex = 'M' then sex2 = 1;
else sex2 = 2;
if name in ('Alfred','Alice','Barbara') then age =.;
format sex2 sex. age age.;
run;

%popfmt(class,sex2,uniqueid=name) ;

%unistats(dsin=class, unicatrep=yes, misspct=yes, varlist= age, pvarlist= age);

%unistats(dsin=class, unicatrep=yes, misspct=no, varlist= age, pvarlist= age);


Could somebody tell me how can I get percentages only based in the non-missing values?

I would like to know also if programmers are using this macros?

Thanks in advance!!

Juan Vte.
1 REPLY 1
JuanVte
Calcite | Level 5
Ok, I got it!!

the solution regards in the use of the parameter pctcalc=cat!!

As I said, I am starting to study these macros but at the moment I think these are really recommendable!!

JV

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 1 reply
  • 982 views
  • 0 likes
  • 1 in conversation