2
votes

I am trying to compare two models where the smaller one is what I hypothesize to be the best model, and then the larger one is the complete model with all variables. I would like to use the "test statement" in proc logistic to compare the models to determine if any of the additional variables might potentially be significant. The problem is that test does not seem to be recognizing my categorical variable (d) as shown below:

proc logistic data = test;
class d (param = ref  ref = '0');
model y (event = '1') = a b c d;
test1: test c=d=0;
run;

This is the image of the error showing in the log

So essentially I am testing to see if it is possible that either c or d could be significant predictors in the model.

Also, I'm not sure if I am using the "test statement" correctly, so any advice on that would be appreciated.

The following is test data you can use:

data test (drop=i);
do i=1 to 1000;
a=round(uniform(1)*4,.01);
b=round(uniform(1)*10,.01);
c=round(uniform(1)*7.5,.01);
if b<2 then d=1;
else d=0;
if i<500 then y=1;
else y=0;
output;
end;
stop;
run;
1

1 Answers

2
votes

From the SAS documentation:

Intercept and CLASS variable parameter names should be specified as described in the section Parameter Names in the OUTEST= Data Set.

So, given your code, you can specify your test statement as:

test1: test c=d1=0;

You should check your OUTEST dataset though to get the exact name. Unfortunately this does mean you run the proc twice, but that's easy enough.