Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The NLIN Procedure

Example 45.3: Probit Model with Likelihood function

The data, taken from Lee (1974), consist of patient characteristics and a variable indicating whether cancer remission occured. This example demonstrates how to use PROC NLIN with a likelihood function. In this case, the likelihood function to minimize is

-2 \log L &=& -2 \sum_{i=1}^N wght_i \log( \hat{p}_i( y_i, x_i) )
where
\hat{p}_i(y_i, x_i) = \{ \Phi( \alpha + {\beta^'x}_i ) & y_i = 0 \ 1 - \Phi( \alpha + \beta' x_i ) & y_i = 1 
 .

and \Phi is the normal probability function. This is the likelihood function for a binary probit model. This likelihood is strictly positive so that you can take a square root of \log( \hat{p}_i( y_i, x_i) ) and use this as your residual in PROC NLIN. The DATA step also creates a zero-valued dummy variable, like, that is used as the dependent variable.

   Data remiss;
      input remiss cell smear infil li blast temp;
      label remiss = 'complete remission';
      like = 0;
      label like = 'dummy variable for nlin';
      datalines;
   1 .8 .83 .66 1.9 1.1 .996 
   1 .9 .36 .32 1.4 .74 .992 
   0 .8 .88 .7 .8 .176 .982 
   0 1 .87 .87 .7 1.053 .986 
   1 .9 .75 .68 1.3 .519 .98 
   0 1 .65 .65 .6 .519 .982 
   1 .95 .97 .92 1 1.23 .992 
   0 .95 .87 .83 1.9 1.354 1.02 
   0 1 .45 .45 .8 .322 .999 
   0 .95 .36 .34 .5 0 1.038 
   0 .85 .39 .33 .7 .279 .988 
   0 .7 .76 .53 1.2 .146 .982 
   0 .8 .46 .37 .4 .38 1.006 
   0 .2 .39 .08 .8 .114 .99 
   0 1 .9 .9 1.1 1.037 .99 
   1 1 .84 .84 1.9 2.064 1.02 
   0 .65 .42 .27 .5 .114 1.014 
   0 1 .75 .75 1 1.322 1.004 
   0 .5 .44 .22 .6 .114 .99 
   1 1 .63 .63 1.1 1.072 .986 
   0 1 .33 .33 .4 .176 1.01 0
   0 .9 .93 .84 .6 1.591 1.02 
   1 1 .58 .58 1 .531 1.002 
   0 .95 .32 .3 1.6 .886 .988 
   1 1 .6 .6 1.7 .964 .99 
   1 1 .69 .69 .9 .398 .986 
   0 1 .73 .73 .7 .398 .986 
   ;
   run;

   proc nlin data=remiss method=newton sigsq=1;
      parms a -2 b  -1 c 6 int -10;
      
           /* Linear portion of model ------*/
      eq1 = a*cell + b*li + c*temp +int;
      
             /* probit */
      p = probnorm(eq1);

      if ( remiss = 1 ) then p = 1-p;

      model.like = sqrt(- 2 * log( p));
      output out=p p=predict;
   run;

Note that the asymptotic standard errors of the parameters are computed under the least squares assumptions. The SIGSQ=1 option on the PROC NLIN statement forces PROC NLIN to replace the usual mean square error with 1. Also, METHOD=NEWTON is selected so the true Hessian of the likelihood function is used to calculate parameter standard errors rather than the crossproducts approximation to the Hessian.

Output 45.3.1: Nonlinear Least Squares Analysis from PROC NLIN

Beaton/Tukey Biweight Robust Regression using IRLS

The NLIN Procedure

NOTE: An intercept was not specified for this model.

Source DF Sum of Squares Mean Square F Value Approx
Pr > F
Regression 4 -21.9002 -5.4750 -5.75 .
Residual 23 21.9002 0.9522    
Uncorrected Total 27 0      
           
Corrected Total 26 0      

Parameter Estimate Approx
Std Error
Approximate 95% Confidence
Limits
a -5.6298 4.6376 -15.2234 3.9638
b -2.2513 0.9790 -4.2764 -0.2262
c 45.1815 34.9095 -27.0337 117.4
int -36.7548 32.3607 -103.7 30.1879

The problem can be more simply solved using the following SAS statements.

proc probit data=remiss ;
   class remiss;
   model remiss=cell li temp ;
run;

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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