Published on :
Statistical CREATION_INTERNE

ODS Documentation Example 3

This code is also available in: Deutsch Español Français
Awaiting validation
The script begins by setting a title for the output ('Oven Measurements'). It then creates an internal dataset 'hh' with temperature measurements. It uses the MIXED procedure to perform a mixed model analysis on this data, with variables 'a' and 'b' as classification effects, and 'y' as the response. The mixed model parameters are specified, and the parameter search output is captured in a dataset named 'parms' via ODS OUTPUT. The ODS SHOW command is used to display active ODS destinations. Next, the script defines a 'surface' graph template using PROC TEMPLATE, which visualizes covariance parameters and log likelihood. Finally, PROC SGRENDER is used to generate this surface plot using the 'parms' data obtained from PROC MIXED.
Data Analysis

Type : CREATION_INTERNE


The 'hh' dataset is created directly in the script using a DATA STEP statement with embedded data (`datalines`). The 'parms' dataset is generated by PROC MIXED and is therefore also internal to the script's execution flow.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block creates a dataset named 'hh' and inserts data directly into it via the `datalines` statement. Variables 'a', 'b', and 'y' are defined and populated with the provided values, representing oven measurements.
Copied!
1DATA hh;
2 INPUT a b y;
3 DATALINES;
41 1 237 1 1 254 1 1 246
51 2 178 1 2 179
62 1 208 2 1 178 2 1 187
72 2 146 2 2 145 2 2 141
83 1 186 3 1 183
93 2 142 3 2 125 3 2 136
10;
2 Code Block
PROC MIXED
Explanation :
This procedure performs a mixed model analysis on the 'hh' dataset. Variables 'a' and 'b' are declared as classification variables. A model is specified where 'y' is the dependent variable and 'a' is a fixed effect. Random effects are defined for 'b' and the interaction 'a*b'. The `parms` statement initializes parameters for optimization. The `ods output ParmSearch=parms` option exports the parameter search results into a new dataset named 'parms'.
Copied!
1PROC MIXED DATA=hh;
2 class a b;
3 model y = a;
4 random b a*b;
5 parms (17 to 20 BY 0.1) (.3 to .4 BY .005) (1.0);
6 ods OUTPUT ParmSearch=parms;
7RUN;
3 Code Block
ODS
Explanation :
Displays active ODS destinations, allowing verification of where output will be directed (e.g., HTML, LISTING, RTF).
Copied!
1ods show;
4 Code Block
PROC TEMPLATE
Explanation :
This block uses PROC TEMPLATE to define a custom statistical graph template named 'surface'. This template creates a 3D surface plot (`surfaceplotparm`) with 'CovP1' on the X-axis, 'CovP2' on the Y-axis, and 'ResLogLike' on the Z-axis, which are variables from the 'parms' dataset.
Copied!
1PROC TEMPLATE;
2 define statgraph surface;
3 begingraph;
4 layout overlay3d;
5 surfaceplotparm x=CovP1 y=CovP2 z=ResLogLike;
6 endlayout;
7 endgraph;
8 END;
9RUN;
5 Code Block
PROC SGRENDER
Explanation :
This procedure renders the graph defined by the 'surface' template (created with PROC TEMPLATE) using the data contained in the 'parms' dataset (generated by PROC MIXED). This allows visualization of the mixed model parameter surface.
Copied!
1PROC SGRENDER DATA=parms template=surface;
2RUN;
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.
Copyright Info : S A S S A M P L E L I B R A R Y NAME: ODSEX3 TITLE: Documentation Example 3 for ODS PRODUCT: STAT SYSTEM: ALL KEYS: ODS PROCS: MIXED, TEMPLATE, SGRENDER DATA: REF: Using the Output Delivery System MISC: