Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The MODEL Procedure

Example 14.1: OLS Single Nonlinear Equation

This example illustrates the use of the MODEL procedure for nonlinear ordinary least-squares (OLS) regression. The model is a logistic growth curve for the population of the United States. The data is the population in millions recorded at ten year intervals starting in 1790 and ending in 1990. For an explanation of the starting values given by the START= option, see "Troubleshooting Convergence Problems" earlier in this chapter. Portions of the output from the following code are shown in Output 14.1.1 and Output 14.1.2.

   title 'Logistic Growth Curve Model of U.S. Population';
   data uspop;
      input pop :6.3 @@;
      retain year 1780;
      year=year+10;
      label pop='U.S. Population in Millions';
      datalines;
   3929  5308  7239   9638  12866  17069  23191  31443  39818 50155
   62947 75994 91972 105710 122775 131669 151325 179323 203211 
   226542 248710
   ;
   proc model data=uspop;
      label a = 'Maximum Population'
            b = 'Location Parameter'
            c = 'Initial Growth Rate';
      pop = a / ( 1 + exp( b - c * (year-1790) ) );
      fit pop start=(a 1000  b 5.5  c .02)/ out=resid outresid;
   run;

Output 14.1.1: Logistic Growth Curve Model Summary

Logistic Growth Curve Model of U.S. Population

The MODEL Procedure

Model Summary
Model Variables 1
Parameters 3
Equations 1
Number of Statements 1

Model Variables pop
Parameters a(1000) b(5.5) c(0.02)
Equations pop


Logistic Growth Curve Model of U.S. Population

The MODEL Procedure

The Equation to Estimate is
pop = F(a, b, c)

Output 14.1.2: Logistic Growth Curve Estimation Summary

Logistic Growth Curve Model of U.S. Population

The MODEL Procedure

Nonlinear OLS Summary of Residual Errors 
Equation DF Model DF Error SSE MSE Root MSE R-Square Adj R-Sq Label
pop 3 18 345.6 19.2020 4.3820 0.9972 0.9969 U.S. Population in Millions

Nonlinear OLS Parameter Estimates
Parameter Estimate Approx Std Err t Value Approx
Pr > |t|
Label
a 387.9307 30.0404 12.91 <.0001 Maximum Population
b 3.990385 0.0695 57.44 <.0001 Location Parameter
c 0.022703 0.00107 21.22 <.0001 Initial Growth Rate


The adjusted R2 value indicates the model fits the data well. There are only 21 observations and the model is nonlinear, so significance tests on the parameters are only approximate. The significance tests and associated approximate probabilities indicate that all the parameters are significantly different from 0.

The FIT statement included the options OUT=RESID and OUTRESID so that the residuals from the estimation are saved to the data set RESID. The residuals are plotted to check for heteroscedasticity using PROC GPLOT as follows:

   proc gplot data=resid;
       plot pop*year / vref=0;
       title "Residual";
       symbol1 v=plus;
      run;

The plot is shown in Output 14.1.3.

Output 14.1.3: Residual for Population Model (Actual - Predicted)
modex01d.gif (3972 bytes)

The residuals do not appear to be independent, and the model could be modified to explain the remaining nonrandom errors.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.