Announcement

Collapse
No announcement yet.

How to create columns for nonexistent data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create columns for nonexistent data

    When creating a DZS Table, the ACROSS variable is a formatted variable and the formats express all the possible values that the ACROSS variable can take up in a the specific study. When the data does not contain all the possible ACROSS variables the table will not create columns for the missing values. There is a way to get the missing columns into the table by taking the following steps:

    Let's assume that our ACROSS variable is treatment group for the DZSTable Macro call.
    1. Add a new variable to the original input data set - FAKE=missing.
    Code:
    data inputData; set inputData;
    fake=.;
    run;

    2. Create an additional data set with ALL possible treatment groups as an observation adding the variable FAKE=1 also
    Code:
    data add; set inputData(obs=1);
    fake=1;
    trtn=1; output;
    trtn=2; output;
    trtn=3; output;
    trtn=4; output;
    run;
    3. Append the additional data set to the input data set:
    Code:
    data inputData; set inputData add; 
      format trtn trtn.
    run;
    4. Run the DZSTABLE macro with the variable FAKE as a title paging variable. The table will have an additional page containing all the ACROSS columns and FAKE=1 in the title. Using the default option UNIFORMACROSS will produce identical pages with all columns.
    Code:
    (titles=%str(Example for more ACROSS treatment columns then data set has\!fake\@)

    5. Eliminate the extra page using MPREGEN=MYMAC.
    Code:
    %macro mymac;
      data _statout; set _statout; if fake=.; run;
    %mend mymac;
    Click SampleAcrossFull.sasto see an example of a program that creates

    ClickSampleAcrossFull.doc to see the output of the example program.
    Last edited by Stella Scafidi; 03-31-2010, 11:36 AM.
Working...
X