Published on :
Statistical CREATION_INTERNE

Documentation Example 6 for PROC NLIN - ODS Graphics and Diagnostics

This code is also available in: Deutsch Español Français
Awaiting validation
The script begins by creating an internal dataset named 'contrived' via a DATA step and datalines. Then, it uses PROC NLIN to fit a nonlinear regression model to the data, specifying the 'alpha' and 'gamma' parameters and the model form. The ODS GRAPHICS option is enabled to produce standardized diagnostic plots, such as bias and Hougaard plots, as well as fit measures.
Data Analysis

Type : CREATION_INTERNE


The 'contrived' dataset is created directly within the SAS script via a DATA step and the DATALINES statement, incorporating the necessary input data for nonlinear regression analysis.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block creates the 'contrived' dataset using the INPUT statement to define variables x1, x2, and y, and the DATALINES statement to provide observations directly in the script. This dataset is then used as input for the nonlinear regression analysis.
Copied!
1DATA contrived;
2 INPUT x1 x2 y;
3 DATALINES;
4-4.0 -2.5 -10.0
5-3.0 -2.0 -5.0
6-2.0 -1.5 -2.0
7-1.0 -1.0 -1.0
8 0.0 0.0 1.5
9 1.0 1.0 4.0
10 2.0 1.5 5.0
11 3.0 2.0 6.0
12 4.0 2.5 7.0
13-3.5 -2.2 -7.1
14-3.5 -1.7 -5.1
15 3.5 0.7 6.1
16 2.5 1.2 7.5
17;
2 Code Block
PROC NLIN
Explanation :
This block uses PROC NLIN to perform nonlinear regression on the 'contrived' dataset. The 'alpha' and 'gamma' parameters are initialized. The model specifies the nonlinear relationship between the dependent variable y and the independent variables x1 and x2. The ODS GRAPHICS option is enabled to generate diagnostic plots such as bias and Hougaard plots, providing a visual assessment of the model's fit.
Copied!
1ods graphics on;
2PROC NLIN DATA=contrived bias hougaard
3 NLINMEASURES plots(stats=all)=(diagnostics);
4 parms alpha=2.0
5 gamma=0.0;
6 model y = alpha*x1 + exp(gamma*x2);
7RUN;
8ods 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.
Copyright Info : S A S S A M P L E L I B R A R Y