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

It is a 3-treatment (A,B,C), 3-period (1, 2, 3), 2-sequence (ABC, BAC). subjects are randomized to the 2 sequences, stratified by BMI (4 levels: 1,2,3,4).
I want to know whether there are response differences between BMI levels (1 vs. 4, 2 vs. 4, 3 vs. 4) within each treatment (A, B, C). I'm testing the model using dummy data. I tried 40 subjects' data, but LSM estimate for the treatment is always NON-est. Of course, result is NON-est for ESTIMATE statment.  Nothing wrong in log, the data will converge. I tried more subjects (80) data, and different dummy data for RESPONSE, but always got NON-est results. Can anyone advise what could possibly go wrong here? Any suggestions will be greatly appreciated!

The data structure is like-

subjid      sequence    period          trt       BMI   response
S1                ABC             1           A         1      xx
S1                ABC             2           B         1      xx
S1                ABC             3           C         1      xx
S2                BAC             1           B         1      xx
S2                BAC             2           A         1      xx
S2                BAC             3           C         1      xx
....

;
proc mixed data = xx;
  class  subjid sequence period bmi trt ;
  model response = sequence period bmi trt bmi*trt;
  random subjid(sequence);
  lsmeans  bmi trt bmi*trt;
  ESTIMATE 'BMI 1 vs. 4 within TRT A' BMI 1 0 0 -1 bmi*trt 1 0 0 -1/cl;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
JamesRoger
Calcite | Level 5

The second half of the answer is a design issue.

You only have two sequences, so that treatment C only appears in period 3 while treatments A and B only appear in periods 1 and 2. So you have aliasing of treatment with period. So when SAS tries to define an lsmean for C say, it wants to give equal weight 0.333333 to each period, but this is not consistent with assigning weights (0,0,1) to treatment.

So your only solution is to remove period from the model.

Now there is nothing wrong with your design. In dose escalation studies we regularly alias dose with period. It is done for safety reasons. You always start testing on small doses. Perhaps you have the same thing here with C being a potentially nasty treatment that you want to leave to the end.

But, if so, you have to then accept that you cannot correct for period. Rather you build into the execution of the experiment/trial measures to reduce the possibility of such a period effect.

James.

View solution in original post

6 REPLIES 6
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

A common cause of this is an empty cell (or cells) for interactions. That is, if there is combination of bmi and trt where there are no observations, then you can't estimate main effects.

SteveDenham
Jade | Level 19

And here it would be trt*sequence.

Two approaches: Calculate marginal response over sequence (add it to the RANDOM statement and remove from MODEL statement). This is not the usual way to deal with this, since the sequence is fixed.

Fit a so-called "means model", which is a one-way setup, with the highest order interaction as the only fixed effect, and calculate differences of interest using the LSMESTIMATE statement.  See Milliken and Johnson's Analysis of Messy Data, or SAS for Mixed Models, 2nd ed. for approaches using the ESTIMATE statement, and translate to LSMESTIMATE.

Steve Denham

letstat
Calcite | Level 5

Thank you, there is no empty cell in my dummy data.

JamesRoger
Calcite | Level 5

Hi there you have two separate problems which you have assumed have the same cause.

Lets solve the Estimate statement first.

First hint with non-estimability is always to add the E option to see what is going on.

  ESTIMATE 'BMI 1 vs. 4 within TRT A' BMI 1 0 0 -1 bmi*trt 1 0 0 -1/ E cl;

                            Coefficients for BMI 1 vs. 4 within TRT A

                     Effect       sequence    trt    period    bmi      Row1

                     Intercept

                     sequence     ABC

                     sequence     BAC

                     period                          1

                     period                          2

                     period                          3

                     bmi                                       1           1

                     bmi                                       2

                     bmi                                       3

                     bmi                                       4          -1

                     trt                      A

                     trt                      B

                     trt                      C

                     bmi*trt                  A                1           1

                     bmi*trt                  B                1

                     bmi*trt                  C                1

                     bmi*trt                  A                2          -1

                     bmi*trt                  B                2

                     bmi*trt                  C                2

                     bmi*trt                  A                3

                     bmi*trt                  B                3

                     bmi*trt                  C                3

                     bmi*trt                  A                4

                     bmi*trt                  B                4

                     bmi*trt                  C                4

Now that is not what you wanted for coefficients for the interaction bm*trt. You were expecting the bmi nested within trt but it has used trt nested within bmi. The reason for that is the order you specified them on the CLASS statement.

  class  subjid sequence period bmi trt;

So the simple solution to the ESTIMATE statement problem is to change the class statement to..

  class  subjid sequence period trt bmi;

Then it is estimable because you are now defining what you wanted in the first place.

                                          Estimates

                                    Standard

Label                     Estimate     Error    DF  t Value  Pr > |t|   Alpha     Lower     Upper

BMI 1 vs. 4 within TRT A    0.7400    0.5128    71     1.44    0.1534    0.05   -0.2826    1.7625

I will answer the second question is a second..

James.;

letstat
Calcite | Level 5

Thank you Steve. What I need is BMI*trt. What do you mean by saying it would be trt*sequence? I will take a look of the 2 approaches you mentioned?

Thank you James. Your suggestion of switching the order of trt and bmi worked for ESTIMATE. Look forward to your shedding light on the LSMEANS statement!

JamesRoger
Calcite | Level 5

The second half of the answer is a design issue.

You only have two sequences, so that treatment C only appears in period 3 while treatments A and B only appear in periods 1 and 2. So you have aliasing of treatment with period. So when SAS tries to define an lsmean for C say, it wants to give equal weight 0.333333 to each period, but this is not consistent with assigning weights (0,0,1) to treatment.

So your only solution is to remove period from the model.

Now there is nothing wrong with your design. In dose escalation studies we regularly alias dose with period. It is done for safety reasons. You always start testing on small doses. Perhaps you have the same thing here with C being a potentially nasty treatment that you want to leave to the end.

But, if so, you have to then accept that you cannot correct for period. Rather you build into the execution of the experiment/trial measures to reduce the possibility of such a period effect.

James.

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
  • 6 replies
  • 6451 views
  • 0 likes
  • 4 in conversation