This script illustrates how to analyze a two-factor experimental design (drug and disease) with interactions, on unbalanced data. It uses the GENMOD procedure to fit the model and the EFFECTPLOT statement to generate various plots: effect plots, sliced interactions, boxplots, and mosaic plots.
Data Analysis
Type : CREATION_INTERNE
Data is dynamically generated in the DATA step 'a' via the DATALINES statement. It simulates a clinical study with 'drug', 'disease' variables, and the 'y' response.
1 Code Block
DATA STEP Data
Explanation : Creation of data table 'a'. The DATA step reads drug and disease identifiers, then loops to read up to 6 'y' measurements per input line.
Explanation : ODS graphics activation. Execution of PROC GENMOD to model the response 'y' (default normal distribution). 'effectplot / obs' displays the effect plot with observations. 'effectplot interaction(sliceby=disease)' displays interactions by slicing by the disease variable, with confidence limits (clm).
Copied!
ods graphics on;
proc genmod data=a;
class drug disease;
model y=disease drug disease*drug / d=n;
effectplot / obs;
effectplot interaction(sliceby=disease) / clm;
run;
1
ods graphics on;
2
PROC GENMODDATA=a;
3
class drug disease;
4
model y=disease drug disease*drug / d=n;
5
effectplot / obs;
6
effectplot interaction(sliceby=disease) / clm;
7
RUN;
3 Code Block
PROC GENMOD
Explanation : Second analysis with complementary visualizations: box plots, cross-interactions with observations, mosaic plots, and interactions faceted by disease (plotby).
Copied!
proc genmod data=a;
class drug disease;
model y=drug disease drug*disease / d=n;
effectplot box;
effectplot interaction(x=drug*disease) / obs;
effectplot mosaic;
effectplot interaction(plotby=disease);
run;
ods graphics off;
1
PROC GENMODDATA=a;
2
class drug disease;
3
model y=drug disease drug*disease / d=n;
4
effectplot box;
5
effectplot interaction(x=drug*disease) / obs;
6
effectplot mosaic;
7
effectplot interaction(plotby=disease);
8
RUN;
9
ods graphics off;
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.