DATA Step, Macro, Functions and more

PRELOADFMT in proc freq or counting percentage in proc summary

Reply
Occasional Contributor
Posts: 10

PRELOADFMT in proc freq or counting percentage in proc summary

Hi,

 

I am trying to get some missing data for the whole class by proc freq.

It can easily be achived by proc summary as below. for example if pregnant='Y' is complety missing , it will still produce the desire result.

 

proc summary data= test completetypes nway ;
  by allgrp nbyvar;
  class pregnent / preloadfmt;
  output out=test1(drop=_type_) / autoname;
  format pregnent  ynf. ;
run;

 

I would like to know the percent as well which is possible in proc freq as below but it does not give me the 0 count for pregnent='Y' even i tried sparse option too.

 

proc freq data= test1 noprint;
 by allgrp nbyvar;
 table pregnent/  out=test2;
 format &var1. ynf. ;
run;

 

 

Is there any way i can achive percent in proc summary or missing count in proc freq?

 

Thanks,

 

 

PROC Star
Posts: 2,311

Re: PRELOADFMT in proc freq or counting percentage in proc summary

It would be a lot easier to understand your need if you provided a data sample and an expected result.

I presume you saw this? What's missing there? 

 

Ask a Question
Discussion stats
  • 1 reply
  • 119 views
  • 0 likes
  • 2 in conversation