Am getting an MMRM as below
proc mixed data=weight;
class sex patid region; month
model chg=baseweight age sex region month month*base/ddfm=ken s;
repeated month/subject=patid type=un;
store out=meanweight;
run;
I would like to make a prediction for chg for a month-outside the sample i.e month is 2 4 6 8 and I would like to make predictions for say month 10.
My approach was
proc plm restore=meanweight;
score data=null out=pred predicted lclm uclm/ilink;
run;
null has a single observation with values for baseweight, sex, region, and month. The problem is that for any month value that is more than 8 ie max visit in study, I get missing predictions. Am I using this procedure wrongly?
Kind regards
W
If you have a model variable that is a class variable, which from your Proc Mixed code (with errors) may be your case then values of the class variable that did not appear in the original model cannot be scored.
When the variable is on the Class statement think "category". So If you have model with race that does not include "Martian" as a value in the base model you can't make predictions about Martians that appear in other data sets.
Try removing Month from the Class statement and then retry. Just be prepared for somewhat odd values in the predictions if your Month is far outside your data used to create the model.
You can't get a prediction for month=10 unless you provide values for baseweight age sex region patid and base in month 10. This really isn't a SAS issue, this is a data issue.
An providing this through the null dataset i.e
data null;
input baseweight age sex $ region month;
datalines;
40 50 F West 10
;
run;
Note base in model is baseweight
Hello,
See this paper (it has multiple PROC MIXED examples) :
Paper SAS3337-2019
SCORE! Techniques for Scoring Predictive Regression Models Using SAS/STAT® Software
Phil Gibbs and Randy Tobias, SAS Institute Inc.
https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf
See also here:
SAS 9.4 / Viya 3.5
SAS/STAT User's Guide
The PLM Procedure
Example 93.1 Scoring with PROC PLM
Koen
If you have a model variable that is a class variable, which from your Proc Mixed code (with errors) may be your case then values of the class variable that did not appear in the original model cannot be scored.
When the variable is on the Class statement think "category". So If you have model with race that does not include "Martian" as a value in the base model you can't make predictions about Martians that appear in other data sets.
Try removing Month from the Class statement and then retry. Just be prepared for somewhat odd values in the predictions if your Month is far outside your data used to create the model.
Thanks, noted the problem.
Kind regards
W
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.