Published on :
Statistical CREATION_INTERNE

PROC NLIN Example with Parameter Profiling and Bootstrap

This code is also available in: Deutsch Español Français
Awaiting validation
The script fits an exponential model to a dataset. It uses the NLIN procedure not only to estimate the model parameters but also to evaluate their stability and sensitivity. The PROFILE statement is used to examine the profile likelihood of two of the parameters, while the BOOTSTRAP statement performs a resampling analysis to provide robust confidence intervals and graphical diagnostics on the estimators.
Data Analysis

Type : CREATION_INTERNE


The 'clarke1987a' dataset is created directly within the script using a DATA step and a 'datalines' statement.

1 Code Block
DATA STEP Data
Explanation :
This code block creates the SAS table 'clarke1987a' in the WORK library. The table contains two numeric variables, 'x' and 'y', whose data is read directly from the input stream via the 'datalines' statement.
Copied!
1DATA clarke1987a;
2 INPUT x y;
3 DATALINES;
41 3.183
52 3.059
63 2.871
74 2.622
85 2.541
96 2.184
107 2.110
118 2.075
129 2.018
1310 1.903
1411 1.770
1512 1.762
1613 1.550
17;
18 
2 Code Block
PROC NLIN
Explanation :
This block activates ODS graphics generation, then executes the non-linear regression procedure (NLIN). It defines the initial parameter values (parms), specifies an exponential model (model), and requests two advanced analyses: a likelihood profiling for 'theta1' and 'theta3' (profile) and a bootstrap analysis with 2000 resamples to obtain confidence intervals and diagnostic plots (bootstrap). ODS graphics are then deactivated.
Copied!
1ods graphics on;
2PROC NLIN DATA=clarke1987a plots(stats=none)=diagnostics;
3 parms theta1=-0.15
4 theta2=2.0
5 theta3=0.80;
6 profile theta1 theta3 / range = -6 to 2 BY 0.2 all;
7 bootstrap / nsamples = 2000 seed=123 bootplots bootci bootcov;
8 model y = theta3 + theta2*exp(theta1*x);
9RUN;
10ods 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