Programming the statistical procedures from SAS

Scoring a new data set based on proc glimmix model

Reply
N/A
Posts: 1

Scoring a new data set based on proc glimmix model

Hi

I am a new user of proc glimmix.

for the simplicity I have a very simple proc glimmix model

where time is random and I need to score a new set of observations with out the need to run again this procedure

currently I am predicting the observations using the pred option , is there a way in SAS 9.2 to score a new data set ?

proc glimmix data=xxx;

      class class1 class2;;

       model y(event='1') = time x1 x2 / s dist=binary;

      random  time/ subject=pat;

run;

Your help is appreciated !

Respected Advisor
Posts: 2,655

Scoring a new data set based on proc glimmix model

You may run into difficulty scoring, as I think you might have some problems with the model you are using.  Are x1 and x2 realizations from class1 and class2?  The random statement as it stands fits a random slope model, with a fixed intercept.  Is that correct?  If so, then I suggest the following:

proc glimmix data=xxx;

      class class1 class2;;

       model y(event='1') = time class1 class2 / s dist=binary;

      random  time/ subject=pat;

run;

Now, as to scoring a new dataset...

If you had SAS 9.3, I would recommend using the STORE command and PROC PLM.  Since this is 9.2, the best I can suggest is to create the dataset yyy as:

data yyy;

set xxx dataset_to_be_scored;

run;

where "dataset_to_be_scored" is the new dataset, but with y set to missing for all observations.  The following should give a dataset with predicted values:

proc glimmix data=yyy;

      class class1 class2;;

       model y(event='1') = time class1 class2 / s dist=binary;

      random  time/ subject=pat;

     output out=scored pred(blup ilink)=predicted;

run;

Hope this helps.

Steve Denham

Frequent Contributor
Frequent Contributor
Posts: 134

Scoring a new data set based on proc glimmix model

The PLM procedure is available in SAS/STAT 9.22, so that might still be an option. I don't know about 9.2....

Occasional Contributor
Posts: 17

Re: Scoring a new data set based on proc glimmix model

In a Mixed model, the random effects are SAMPLED from a potentially large population and may not be replicated. In the general case, you can only do marginal prediction, integrating out random effects, if the levels of random subjects in scoring data set is different from what you used in modeling. What you can do is conducting a monte carlo based approach.

On the other hand if the levels in the scoring data set ARE REPLICATES of those in training data, then what you can do is simply transpose the random effects solution dataset and combined with the fixed effect data set to be the scoring coefficient data set, then apply the design matrices with the scoring coefficient data set in PROC SCORE, just like how you would score in GLM.

Ask a Question
Discussion stats
  • 3 replies
  • 1689 views
  • 3 likes
  • 4 in conversation