BookmarkSubscribeRSS Feed
raisins
Calcite | Level 5
Hi,

Trying to wade through estimate and contrast in proc glimmix. I have a model with a binomial response that I am modelling with 2 continuous variables, 1 categorical variable, and the interaction between the 2 continuous variables and the 1 categorical variable. The categorical variable has only two levels. I would like to perform a joint hypothesis test that all slope coefficients for the interactions are equal to 0. Here's sample code.

PROC GLIMMIX Data=sas3 empirical=df initglm;
class cl1;
MODEL devchng (event='1') =

agricden
grassden
CL1
agricden*cl1
grassden*cl1
/link=logit dist=binomial ddfm=none s stdcoef cl;
run;

Another variation on this model will contain a random effect (this is why I am using glimmix). Hopefully this will not change things too much.

Can someone jot a simple code that tests whether the slope coefficients associated with the two interactions are equal to 0?

Thanks,

Seth
5 REPLIES 5
SteveDenham
Jade | Level 19
I won't guarantee this will work, but it should test what you want. By specifying 'NOINT', you should get estimates for each slope, and the tests will be in the fixed effects solution. Try:
PROC GLIMMIX Data=sas3 empirical=df initglm;
class cl1;
MODEL devchng (event='1') =

agricden
grassden
CL1
agricden*cl1
grassden*cl1
/link=logit dist=binomial ddfm=none s stdcoef cl NOINT;
run;


Good luck,

SteveDenham
Dale
Pyrite | Level 9
There are a couple of ways that you could test the joint hypothesis regarding all of the interaction effects. You could construct a likelihood ratio test by removing the interaction terms and refitting the model, The change in -2LL follows an approximate chi-square distribution with df equal to the number of parameters which have been removed from the model (2 in this case). A likelihood ratio test can be employed even when you have random effects in the model if you specify use of quadrature or laplace methods for approximating the integration of the random effects.

Alternatively, you can use a CONTRAST statement to test the joint null hypothesis. In this case, the CONTRAST statement would be:

contrast "Interaction joint null"
  agricden*cl1   -1 1,
  grassden*cl1   -1 1;
raisins
Calcite | Level 5
Thanks everyone. I will be using the empirical procedure option with a spatial covariance random effect which fits a GEE-type model. In that case, likelihood estimation is not used and likelihood based fit statistics are not returned. Instead, pseudo-likelihood takes its place, which from the SAS documentation disallows model comparison using things like pseudo-AIC, and by extension I would assume would disallow likelihood ratio tests involving the full and reduced models. If I were to use a contrast statement with random effects, am I correct to assume that the spatial covariance structure used in the contrasts are those from the full model? Otherwise, the model would need to be fit twice. When fit separately, the full (with interaction) and reduced models have slightly different covariance structures. Is this a potential issue with a fix by setting some procedure options?

Seth
Dale
Pyrite | Level 9
You are correct that likelihood ratio tests are not available when using a pseudo-likelihood estimation technique. In that case, a test of the joint effects using a CONTRAST statement is really your only option.

I really don't understand your comment at the end of your follow-up post in which you suggest fitting the model twice, even when using a CONTRAST statement. A CONTRAST statement only operates on the parameter estimates and associated covariance structure from the model which generated the point estimates.
raisins
Calcite | Level 5
Thanks Dale. I was taking the idea of a likelihood ratio test and applying it to a joint hypothesis test on the parameter estimates. With the likelihood ratio test, you would fit two models and so there would be two different covariance structures. This would not be the case with a joint hypothesis test, as they work on different concepts (as far as my current level of understanding). So, my last bit was indeed nonsensical!

Seth

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
  • 5 replies
  • 2042 views
  • 0 likes
  • 3 in conversation