BookmarkSubscribeRSS Feed
TomHsiung
Quartz | Level 8

Hello,

I intend to test a interaction between two variables, but not via multiplicative interaction variable (e.g., Y = beta0 + beta1*X1 + beta2*X2 + beta3*X1*X2).

 

My GLM model is Y = beta0 + beta1*X1 + beta2*X2. After the PROC GLM I got the estimation of beta1 and beta2 with their 95% confidence intervals. Both X1 and X2 are binary variables, means they either can be 0 or 1, respectively.

 

Now I want to estimate the interaction contrast (additive interaction instead of multiplicative one), defined as,

 

Interaction contrast = Y11 - Y01 - Y10 + Y00, and to compare it with ZERO. It would be better to have its 95% confidence interval. However, I don't know how to. Thanks.

6 REPLIES 6
PaigeMiller
Diamond | Level 26

You haven't defined Y00 Y01 Y10 Y11.

 

If I were to guess, you DO want what you call the multiplicative interaction, and then the LSMESTIMATE statement in PROC GLIMMIX should be able to get you the quantity of interest.

 

But really, don't make us guess. Define your variables.

--
Paige Miller
TomHsiung
Quartz | Level 8
PROC GLMSELECT DATA=WORK.D201;
MODEL Average_daily_dose_during_the_in=Age__y_ Gender_code BSA AF Hypertension CHF Hypoalbuminemia_code AKI_for_T_test Potential_amiodarone_DDI T_test___indication var33 var34 / SELECTION=stepwise(SELECT=sl SLENTRY=0.20 SLSTAY=0.05 CHOOSE=adjrsq);
STORE WORK.DOSEMODEL / LABEL='Linear Regression';
RUN;

%PUT=&_GLSIND;

PROC GLM DATA=WORK.D201;
MODEL Average_daily_dose_during_the_in=&_GLSIND / solution CLPARM;
RUN;

PROC PLM RESTORE=WORK.DOSEMODEL;
SCORE DATA=WORK.PREDICTED out=WORK.NEWDOSE predicted lclm uclm lcl ucl stderr / ALPHA=0.05;
RUN;

Thanks for your reply, Miller. Above is my code.

 

The two independent variables I am interested are AKI_for_T_test and var34. I want to test the interaction between the two but I don't like to use the multiplicative interaction variable (i.e., AKI_for_T_test*var34). Rather, I would like to use the additive interaction parameter. Both AKI_for_T_test and var34 can only be either 0 or 1. So there are four possible combinations, corresponding to Y11, Y01, Y10, and Y00. Y is the dependent variable Average_daily_dose_during_the_in.

 

StatDave
SAS Super FREQ

What you have defined is the difference in difference. It is indeed estimated by the interaction of the two predictors in the case of an normally distributed model as fit in PROC GLM. See this note that discusses it both for that model and for generalized linear models. The note uses PROC GENMOD, but it applies equally to PROC GLM.

TomHsiung
Quartz | Level 8

OK. Let me take a look.

What does it mean if the regression without interaction parts display significance for a parameter, and later another regression having interactions parts with that parameter lost this significance for that parameter?

 

For example,

Y = beta0 + beta1 X1 + beta2 X2, showing beta1 is not zero.

Later,

Y = beta0 + beta1 X1 + beta2 X2 + beta3 X1*X2, showing beta2 is zero while beta3 is not zero.

TomHsiung
Quartz | Level 8
However, the method described in this note is derived from a model that includes the interaction part. How to acquire the result of a same function (difference in difference) in a model that does not have the interaction part? Thank you
StatDave
SAS Super FREQ

If you don't include the interaction parameter, then you are *assuming* that the interaction as you've written it is zero. So there would be nothing to estimate in such a model other than zero. To see this, use the first example in the note I referred to and run this code that fits the model without interaction and estimates the 4 components of the interaction using ESTIMATE statements. If you compute your interaction using those 4 estimates you will see it is zero. This is also done by the NLEstimate macro using the parameters of the model to compute each component of the interaction and the overall interaction which again gives zero. If you want to allow for the *possibility* of interaction (it could still be zero if that's what the data shows), then you have to include the interaction term in the model and then estimate it to *see* if it is zero.

      proc genmod;
        class a b / ref=first;
        model y = a b ;
        store mod;
        estimate "y00" intercept 1 a 0 1 b 0 1 / e;
        estimate "y10" intercept 1 a 1 0 b 0 1 / e;
        estimate "y01" intercept 1 a 0 1 b 1 0 / e;
        estimate "y11" intercept 1 a 1 0 b 1 0 / e;
        run;
     %nlest(instore=mod, 
                  label=y11-y01-y10+y00,
                  f=( (b_p1+b_p2+b_p4) - (b_p1+b_p4) ) -
                    ( (b_p1+b_p2)           - (b_p1) ),
                  title=interaction)

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 869 views
  • 1 like
  • 3 in conversation