1
votes

I've run a zero-inflated Poisson model using proc genmod and I'm trying to score my test data set using Proc PLM but it's giving me this error:

proc genmod data = train2;
class region  / param=glm;
model response = var1 var2 var3 var4 var5
                    / dist=zip;
                    zeromodel;
output out = zeropoisson_output predicted= estprobzip;
store zero_poisson;
run;


proc plm source=zero_poisson;
  score data = test2 out= pred_zip;
run;

ERROR: Scoring zero-inflated models is not supported in this release of the PLM procedure.

any ideas of how to get around this?

1
Specifically, what version of SAS/STAT? (Starting after SAS 9.22, they began issuing separate release numbers, which would begin with 12.1, which came out with SAS 9.3).Joe
I'm using SAS EG 4.3 but SAS Base is 9.3 - I'm not sure how to get additional version info or if there is any?Charlotte Stevens
You can look at the Server (commonly Local Server if you are doing this on your desktop, otherwise pick the server), right click, select Properties, then select "View initialization log", which will include information about your version, including SAS/STAT version.Joe
It looks like SAS/STAT 13.1 (base 9.4) is where they added the Zero Inflated method scoring to PLM, see this page and contrast with this page from 9.3/12.1 which doesn't have an entry for the 9.4 page on its left bar.Joe
ah...any ideas how i could perhaps score it up manually? if it were a normal logit/poisson model then i could start manually scoring it using variable coefficients but with a zero inflated model i'm a little confused as to how i would go about this?Charlotte Stevens

1 Answers

0
votes

It will take considerably more effort, but you could always use the ODS output option to get the Parameter Estimates and parse through the data from there. I grabbed some example data from a SAS example on genmod and have demonstrated the concept of saving the coefficients and parsing through them below. The output is a .sas file that can be %included in any data step to score a validation sample.

data drug;
   input drug$ x r n @@;
   datalines;
    A  .1   1  10   A  .23  2  12   A  .67  1   9
    B  .2   3  13   B  .3   4  15   B  .45  5  16   B  .78  5  13
    C  .04  0  10   C  .15  0  11   C  .56  1  12   C  .7   2  12
    D  .34  5  10   D  .6   5   9   D  .7   8  10
    E  .2  12  20   E  .34 15  20   E  .56 13  15   E  .8  17  20
    ;
run;

ods output ParameterEstimates = ZIP_COEFF_EST;
proc genmod data=drug;
      class drug;
      model r/n = x drug / dist = zip;
      zeromodel;
run;
ods output close;

data ZIP_COEFF_EST_Parsed;
    length equation $ 2500;
    set ZIP_COEFF_EST (rename=(estimate=coefficient)) end=last;
    where coefficient ne .;
    if upcase(Parameter) = "INTERCEPT" then do;
        equation = " = " || trim(left(put(coefficient,20.10)));
        output;
    end;
    else if LEVEL1 ne '' then do;
        equation = " + (" || trim(left(Parameter)) || " = '" || trim(left(LEVEL1)) || "') * (" || trim(left(put(coefficient,20.10))) || ")";
        output; 
    end;
    else do;
        equation = " + " || trim(left(Parameter)) || " * (" || trim(left(put(coefficient,20.10))) || ")";
        output;
    end;
    if last then do;
        equation=';';   
        output;
    end;
    keep equation;
run;

data _null_;
    set ZIP_COEFF_EST_Parsed;
    FILE  "C:/estimate_file.sas";;
    PUT equation;
run;