Multiple Logistic Regression using SAS

 

As we have done in simple logistic regression, we need to combine the variable about the number of cylinders (cyl) into two groups: <6 or >= 6. The new variable cyl_two will be coded as 1 is cyl >= 6 or 0 if cyl < 6. Cyl_two will be used as outcome variable and use highway mpg (hwy) as predictor variable. The desc option on the proc logistic statement is necessary so that SAS models the probability of being cyl >= 6 (i.e., cyl_two = 1).  The expb option on the model statement tells SAS to display the exponentiated coefficients (i.e., the odds ratios).

data mpg;
  set mpg;
  if cyl >= 6 then cyl_two = 1;
  else cyl_two = 0;
run;
proc logistic data = mpg desc;
  model cyl_two = hwy displ drv/ expb;
run;

 

 

See Also:

Do the same test in R

Leave a Reply

Your email address will not be published. Required fields are marked *