BookmarkSubscribeRSS Feed
TamaraTavares
Calcite | Level 5

Hello All,

 

I just started learning and using SAS in order to run a mixed models analysis. I have a 2 level design with a random intercept and several covariates (my code is below).

 

Proc Mixed Data=lib.vent_data2 METHOD=ML COVTEST;
Class Family_ID GS_Time1 gender_time1;
Model TotalVent_Diff_T2_T1_ICV =GS_Time1 YrsfromAV_AAO_Time1
GS_Time1*YrsfromAV_AAO_Time1 gender_time1 /SOLUTION CL;
RANDOM intercept /SUBJECT=Family_ID;
title VentDiff_ICV=ran the model from two above with the yrsfrom onset w/out const a there is no quad;
Run;

 

After I ran this code I found a significant interaction between two of the level 1 covariates (GS_Time1*YrsfromAV_AAO_Time1), where GS_Time1 is a categorical variable with three levels and YrsfromAV_AAO_Time1 is a continous variable. I am wondering how I can unpack this interaction? I have seen examples of how to unpack a cross-level interactions but not sure how to unpack a within-level interaction.

 

Thank you in advance for your help!

 

 

7 REPLIES 7
ebowen
Quartz | Level 8

If I understand your question correctly, you're asking how to interpret the coefficient on YrsfromAV_AAO_Time1 given the interaction with your time class variable. You can think of the interaction term as a series of dummy variables (0 or 1) that change the marginal effect of YrsfromAV_AAO_Time1 depending on which time period you're in. So you have a model that looks like the following:

 

y_it = B_1*x_1t + B_2t*x_2t*x_1t

where x_1t is the YrsfromAV_AAO_Time1 variable and x_2t is the time period dummy variable.

 

When you take the marginal of this, you get:

dy/dx_1t = B_1 + B_2t*x_2t

 

So your marginal effect is going to be dependent on which time period you're in. The coefficient then becomes the beta on YrsfromAV_AAO_Time1 + the beta on whichever time variable is positive (1) in that observation. To get an overall marginal effect of YrsfromAV_AAO_Time1, you would need to calculate the average of the marginal effects for each observation.

TamaraTavares
Calcite | Level 5

Thank you for your reply.

 

I have an interaction with YrsfromAV_AAO_Time1 (a continous variable) and GS_Time1 (3 groups). I was interested in unpacking this interaction to see what is driving the significant interaction between my groups.

 

Can I still use the method you described to do this?

 

Thank you,

Tamara 

ebowen
Quartz | Level 8

OK, maybe I misinterpreted your question. Are you trying to understand why the coefficient on the interaction term is statistically significant for one group and not for another? It's hard for me to say, as it would depend on your model and what the time periods mean in the context of your analysis. Perhaps there was some change from one year to the next that would explain why that interaction is significant.

TamaraTavares
Calcite | Level 5

I am sorry for any confusion! I will try to explain my situation more clearly.

 

I am interested in examining ventricular volume over time. I computed a difference score for ventricular volume (Time 2-Time1), which is my outcome variable. I built a model using Proc Mixed to examine whether the difference score varies by genetic status (GS) and years to expected symptom onset (YrsfromAV_AAO). I found a significant interaction between GS and YrsfromAV_AAO, however, I am not sure how I can unpack this interaction. Specifically, I wanted to see whether the groups have a different relationship between my predictor variable (YrsfromAV_AAO) and my outcome variable (ventricualr volume difference score). Is there a way I can test to see how the groups may differ? I have tried using proc plm to examine the relationship between my predictor variable (YrsfromAV_AAO) and my outcome variable (ventricualr volume difference score) but I am not sure if this is appropriate.

 

Thank you in advance for your help!

Best,

Tamara

ebowen
Quartz | Level 8

OK, I apologize if I'm not understanding or explaining my meaning. It sounds like what you're asking is how to tell if the relationship of your predictor variable (YrsfromAV_AAO) to your outcome variable (ventricualr volume difference score) changes depending on which genetic status category the subject falls under. That's what the coefficient on the interaction term will tell you. Depending on the GS category, the coefficient on the YrsfromAV_AAO variable (which represents the slope of the linear relationship with your outcome variable) would go up or down equivalent to the coefficient on the interaction term for that GS group.

 

I haven't used PROC PLM, so I can't help you there, sorry. Just quickly reading through the documentation, it seems to be a procedure to do post-processing of the output from procedures like PROC MIXED in order to get average marginal effects. But I don't know much about it.

TamaraTavares
Calcite | Level 5

That makes sense! Thank you so much for your help!

ebowen
Quartz | Level 8

You're welcome! Glad we could narrow it down!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 2013 views
  • 0 likes
  • 2 in conversation