Posts

Showing posts with the label Zero Observations

Dummy Dataset or SAS Options: Which is better to insert a Zero Row?

Image
Always, programmers need to summarize the demographics data and show it in a table and to do so they use Proc Freq procedure. Even though proc Freq calculates the Frequency exactly, it may not be the write procedure in all cases especially when data do not exist. Some times statistician wants to see all the data values on the CRF in the final table, even though there is no combination as such exists in the dataset. In this case we have to insert observations with 0 values. Here I will present you ….the different methods to insert a zero row. 1) Creating a Dummy Dataset and Concatenate the dummy dataset with the input dataset. 2) Proc Freq SPARSE option 3) Proc Means COMPLETETYPES Option 4) Proc Means COMPLETETYPES O ption with PRELOADFMT option. Dummy Dataset: Adv: Simple and doesn’t need any formats Caveat : Programmer has to know all the possible combinations Sparse Option: Lists all possible combinations of variable levels even when a combination does not occur. Syntax: p...