Announcement

Collapse
No announcement yet.

Using the Toptot Option

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

  • Using the Toptot Option

    When using the STACK option in certain report layouts, the UNDER variable can be pulled to the top level as a total value. To avoid this you must:
    · Use the parameter TOTTEXT
    · The UNDER variable has to be equal to the TOTTEXT value in the first line directly under the top variable.
    If these requirements are satisfied then the line containing the TOTTEXT will be lifted to the top alongside the top variable showing the values ‘as totals’ in all the columns.

    This option works similarly the TOTFIRST option (from ver.6.07) but it is more sophisticated. Key variables are repeated on any new page and the under-under structure is not broken by page changes.

    The TOPTOT option can be used in both DZSLIST and DZSTABLE. When used, it automatically initiates the STACK option.

    Example for DZSLIST:

    Input Data set (contains the text ‘-Total’ as the first position for the under variable, as it is needed to ‘stack’ the line up):



    Set the macro variable for TOTTEXT (it has to be identical to the text in the data that identifies the line to be ‘stacked’ up – in this case ‘-Total’):

    %let Ttext=-Total;

    Running the job without TOPTOT option using the following parameter:

    colvars=<.s[email protected]@ .r[email protected]@ .agegrp> [email protected] pct,

    Below is an example of a DZS List without using TOPTOT.


    Below is an example of DZS List using the TOPTOT option.


    Below is an example of using the TOPTOT option in DZSTable.

    See the preprocessing program used in creating the DZS Tables.
    **Set the macro variable _AETOT_ to the label we want to use as total Adverse Events for each Body System.**;
    %let _aetot_=-Total;

    **Create data set from origin AE with ALL patients.**;
    data all; set data.ae; run;

    **Create AE data set with only the patients who had adverse events.**;
    data ae; set all; if aeYes=1; run;

    **Analysis variables are created in this data step.**;
    **Set DISCRETE to 1 for unique aePref/subjId combinations.
    (Patient number for each AE in that BS)**;
    **Variable PRESENT represents the actual adverse events.
    (AE numbers for that AE in that BS.)**;
    procsort; by aePref trt subjId;
    data ae; set ae; by aePref trt subjId;
    if first.subjId then discrete=1; else discrete=.;
    present=1;
    label discrete='nPt (%)'/**Variable labels will be Column head labels**/
    present='nAe';
    run;

    **Software totals and subtotals would count all events. We need to create
    our own totals which gives us the patient count only once.**;
    procsort; by bs trt subjId;
    data ae; set ae; by bs trt subjId;
    output;
    aePref="&_aetot_"; /**Fake AE for the total lines**/
    if first.subjId then discrete=1; else discrete=.;
    present=1;
    output;
    run;

    **Add fake Body System for the first line in table.**;
    procsort; by trt subjId;
    data ae; set ae; by trt subjId;
    output;
    if last.subjId thendo;
    bs='-Total Number of Subjects with Ae' ;
    aePref="&_aetot_";
    discrete=1;
    present=1;
    output;
    end;
    label BS='@Preferred Terms by Body Sysytem';
    run;

    Click here to see SAS programs showing DZS Tables without TOPTOT and with TOPTOT.

    Below is the resulting DZS Table without TOPTOT.

    Click here to see DZS Table with TOPTOT.

    Attached Files
Working...
X