Hi all,
I'm attempting to probe and plot interactions of my negative binomial that was analyzed using PROC GLIMMIX. Briefly, I'm examining the effect of two continuous variables. treatment week (ranging from 1-8) and affect, on various skewed and overdispersedoutcomes, along with several covariates (all mean-centered prior to analysis) and an offset to account for differences in exposure.
Across my models, I have two significant interactions but am having difficulty plotting them. I've been following the resources through UCLA (https://stats.oarc.ucla.edu/sas/seminars/analyzing-and-visualizing-interactions/). I'm able to successfully store my interaction. I then run an estimate
*Week = 3 (centered mid-way pt);
*CU = 0 (centered mean);
Title 'Estimating AB using';
PROC PLM restore = INT;
estimate 'pred behavior_aggress, cweek = 3, CU = 0' intercept 1 cweek 3 cpticu24 0 week*pticu24 0 / e;
RUN;
I am successfully able to test my simple slopes and find that the effect of time leads to less aggressive bx at lower levels of the affective trait. Here is where I run into trouble:
***I'm using the mean centered values to create a dataset called timeout
-11.64 = value of affect 1 SD below mean
-.76 = value of mean affect
10.12 = value of affect 1 SD above mean;
Title 'creating dataset to plot interactions';
data timeout;
do ccu = -11.64, -.76, 10.12;
do cweek = 1 to 8 by 0.1;
output;
end;
end;
run;
***I then set the layout of the plot;
Title 'Setting layout of plot';
PROC PLM source = AGGBXINT;
score data = timeout out = plotdata predicted = pred lclm = lower uclm = upper;
RUN;
I get the following error: At least one variable used in the model is not present or has incompatible type in the WORK.TIMEOUT score data set. All computed score variables are set to missing in WORK.PLOTDATA.
Plotting the figure via SGPLOT doesn't happen because the LL/UL values haven't been computed. My variables appear to be formatted correctly and I don't have any missing data. Importantly, I get this same error when I use non-centered variables (i.e., no negative values for 1 SD below the mean).
I've scoured the internet with little luck and would love any/all feedback.
I imagine I'm doing something terribly wrong.
Thanks.
This error message:
At least one variable used in the model is not present or has incompatible type in the WORK.TIMEOUT score data set.
suggests that you might want to examine variables included in your modeling data set and this scoring data set TIMEOUT. Maybe do a PROC CONTENTS on both data sets to find the discrepancy.
Thanks,
Jill
Hi @jiltao - apologies for the delay, finally getting back around to this project.
Thanks for your suggestion. I tried running a PROC CONTENTS on those datasets.
I was able to successfully run it on the WORK.TIMEOUT dataset but SAS could not locate the interaction/scoring dataset. It is not in my WORK folder or anywhere else.
Let me know if you have any thoughts. Is this something I need to contact SAS support for?
Thanks much.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.