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.
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!
proc mixed data=hh;
class a b;
model y = a;
random b a*b;
parms (17 to 20 by 0.1) (.3 to .4 by .005) (1.0);
ods output ParmSearch=parms;
run;
1
PROC MIXEDDATA=hh;
2
class a b;
3
model y = a;
4
random b a*b;
5
parms (17 to 20BY0.1) (.3 to .4BY .005) (1.0);
6
ods OUTPUT ParmSearch=parms;
7
RUN;
3 Code Block
ODS
Explanation : Displays active ODS destinations, allowing verification of where output will be directed (e.g., HTML, LISTING, RTF).
Copied!
ods show;
1
ods 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.
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!
proc sgrender data=parms template=surface;
run;
1
PROC SGRENDERDATA=parms template=surface;
2
RUN;
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:
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.