University of Rochester Medical Center
SearchDirectoryNewsEventsStrong HealthURMC Home
 

SAS Helpful Hints

Biostat Macro Library

Mass Production of Proc GLM

%Anovas resides in the departments SAS Macro Library and is enabled with the following SAS statements:

Libname biostat '\\BIO2\example\SASMacrosWindows';
Options Mstored SasMstore=biostat;

%Anovas runs anovas on the changes from baseline and washout, at each visit, for each dependent variable. %Anovas was designed to run many Anovas simultaneously. %Anovas also reduces the pages of output created from Proc Glm by eliminating the class page and condensing the output. This macro saves a lot of time in the production of Anovas for many clinical research projects. Unfortunately this macro does not allow any of the options often used with Proc Glm.
%Anovas can be run in three modes:
Mode=1: Model dependent change from baseline=group site covariate_list dependent_at_baseline / CLParm.
Mode=2: Model dependent change from baseline=group site covariate_list dependent_at_baseline group*site.
Mode=3: Group is continuous to test for a linear trend. (Treatment as continous)

There should be only one observation in the dataset for each subject visit. Visits with less then 20% of enrolled subjects are dropped. If 80% of the data are missing, the Anova may not be informative. Group and site should not be included the covariate list or class list. This macro inserts group and site into the class and model statements. Adding group or site to the Covlist will create duplicate entries in the model statement. Site, Covlist and Classlist may be left blank. If washout equals baseline, no washout anovas will be run. Means and LSMeans statements, by treatment are included. Summaries of treatment effects are printed at the end of the output. If Linear Trend(mode=3) is selected, the summary contains the treatment effects from the type III sum of squares from the linear trend model. Otherwise the summary contains the treatment effects from the type III sum of squares from the first model, without the interaction.

Syntax:
%Anovas(dataset,who,group,site,mode,visit,baseline,washout,covlist,classlist,varlist,outfile);
    dataset:    Dataset to use.
    who:        Subject ID.
    group:      Treatment group(Numeric).
    site:          Site(Optional).
    mode:      1(Simple), 2(+treat*Site), 3(+Linear Trend).
    visit:         Time variable: visit, week, month.(Numeric)
    baseline:   Baseline visit(Numeric Constant).
    washout:  Washout visit(Numeric Constant).
    covlist:     Covariate list(Optional).
    classlist:   Class variables(Optional).
    varlist:      List of dependent variables.(Numeric)
    outfile:     Output file.

Example:
%Anovas(work.A,id,treatment,site,2,visit,0,0,gender age,gender,A B C D,C:\Anova.out);
%Anovas(work.A,id,treatment,,3,visit,0,0,,,A B C D,C:\Anova.out);


Estimate statements may be added by creating a macro named “Estimates” before calling %Anovas:

Example:
%Macro Estimates;
    Estimate 'Placebo vs Low Dose' treatment -1 1 0 0;
    Estimate 'Placebo vs Med Dose' treatment -1 0 1 0;
    Estimate 'Placebo vs High Dose' treatment -1 0 0 1;
%Mend;
%Anovas(work.A,id,treatment,site,2,visit,0,0,gender age,gender,A B C D,C:\Anova.out);

The number of digits displayed in the summary tables can be changed by defining a macro variable named “Digits” before calling the procedure:

%Let Digits=3;

Several styles of HTML output can be requested by defining a macro variable named "HtmlStyle" before calling the procedure:

%Let HtmlStyle=URbw1;

Available styles include: URbw1, URpp1, BarrettsBlue, Beige, Brick, Brown, D3D, Default, Minimal, NoFontDefault, Printer, RTF, Statdoc, Theme, FancyPrinter, SansPrinter, SasdocPrinter and SerifPrinter.

The HTML output may be directed to a file by defining a macro variable named "HtmlFile" before calling the procedure:

%Let HtmlFile=c:/test.html;

The size of the text in the HTML output may be changed by defining a macro variable named "HtmlSize" before calling the procedure:

%Let HtmlSize=-1; *or;
%Let HtmlSize=+1;

The resulting output is best read and formatted with Microsoft Word.

Output:

Output:

Output:

 

Please send your comments and suggestions about this web page to A. Watts (watts@bst.rochester.edu)