Chapter Contents 
Previous 
Next 
The MODEL Procedure 
This example illustrates the use of the MODEL procedure for nonlinear ordinary leastsquares (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 * (year1790) ) ); fit pop start=(a 1000 b 5.5 c .02)/ out=resid outresid; run;Output 14.1.1: Logistic Growth Curve Model Summary


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)
Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.