BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sbampah
Fluorite | Level 6

I have count outcomes collected longitudinally at baseline and two post baseline time points: Time: 0,1,2 and Treatment group of two levels: A and B

 

proc glimmix data=work.Regg method=quad;

   class Study_ID Trt Time;

   model Y= Trt Time Trt*Time /solution link=log s dist=nb;

   random int / subject=Study_ID;

run;

Negative binomial mixed effects model:

log(Mui_ofY)=Beta_0+Beta_1Trt_A + Beta_2Time1 +Beta_3Time2+ Beta_4Trt_A*Time1 + Beta_5Trt_A*Time2 + Random_int

Note: Refs for Trt is B, and Time is Time 0

I am interested in estimates/contrast for reduction in mean of Y at time 1 relative to baseline for only Treatment A:

which is Beta_2 + Beta_4 and used the estimate statement below but does not work for me.

 

   estimate "Trt A  Time 1 vs Time 0"  intercept 0

                                Trt      0

                                Time     1 0  0 

                                Trt*Time 0 1 0 0 0 0;

 

 

This results in non-est, can someone help please ?

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

There are examples at the link I gave.

 

Maybe something like

 

lsmeans time/lines;
--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Typically, non-est for interactions happens because the interaction cannot be estimated. This is almost always due to cells in the design where there are zero observations.

 

For example, in this simple data set below, you cannot estimate the X1*X2 interaction because there is an empty cell where x1=0 and x2=0

   x1    x2   y
    0     1   5
    1     0   8
    1     1   4

Also, there is almost never a need to compare Time 1 versus Time 0 via an ESTIMATE statement. The LSMEANS statement will do the comparison for you with much less effort on your part.

 

 

--
Paige Miller
sbampah
Fluorite | Level 6
Thank you for the insight it is very helpful, however, how do we specify this test with lsmeans ?


Steve B. Ampah,



PaigeMiller
Diamond | Level 26

There are examples at the link I gave.

 

Maybe something like

 

lsmeans time/lines;
--
Paige Miller
sbampah
Fluorite | Level 6
Thanks very much, while it worked I had to add a little more code to get what I wanted.
lsmeans Time*Trt/ slice=Trt lines;
The above code gives me what I want.
Thank you.

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
  • 4 replies
  • 847 views
  • 2 likes
  • 2 in conversation