mlmsumry Macro for Linear Models Analysis (GLM)

This code is also available in: Deutsch Español Français
Difficulty Level
Beginner
Published on :
The `mlmsumry` macro configures ODS outputs to capture model ANOVA tables and multivariate statistics. It executes `PROC GLM` with the provided parameters (classes, model, contrasts, repeated measures). Then, it processes the output tables (`_between_`, `_error_`) via DATA steps to consolidate results, calculate degrees of freedom, and format hypothesis types, before displaying the results.
Data Analysis

Type : EXTERNAL


The code expects an input dataset via the `data` macro parameter (default `_last_`). It does not create hardcoded data but manipulates temporary ODS tables generated by the procedure.

1 Code Block
PROC GLM
Explanation :
Configuration of ODS destinations to capture statistical results and execution of the GLM (General Linear Model) procedure with specified model parameters.
Copied!
1ods OUTPUT MultStat = _within_ BetweenSubjects.ModelANOVA = _between_ ModelANOVA = _anova_;
2ods OUTPUT Contrasts = _contrasts_;
3 
4PROC GLM DATA=&DATA;
5 class &class;
6 model &model;
7 &contrasts
8 &repeated
9RUN;QUIT;
2 Code Block
DATA STEP Data
Explanation :
Processing of ODS results tables. Separates error sources and effects ('Between' vs 'Error'), calculates degrees of freedom (NumDF, DenDF), and restructures the table for the final report.
Copied!
1DATA _between_ _error_;
2 SET _between_(in=inb) ... ;
3 IF SOURCE = 'Error' THEN OUTPUT _error_;
4 ELSE DO; ... OUTPUT _between_; END;
5RUN;
6 
7DATA _between_;
8 retain SOURCE FValue NumDF DenDF ProbF;
9 IF _n_=1 THEN SET _error_(rename=(df=DenDF));
10 SET _between_;
11RUN;
3 Code Block
PROC PRINT
Explanation :
Display of the consolidated statistics table if the multivariate tests option is enabled.
Copied!
1PROC PRINT;
2%END;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.

Related Documentation

Aucune documentation spécifique pour cette catégorie.