BookmarkSubscribeRSS Feed
Life
Calcite | Level 5

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 !

3 REPLIES 3
SteveDenham
Jade | Level 19

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

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

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

oloolo
Fluorite | Level 6

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 4927 views
  • 3 likes
  • 4 in conversation