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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

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