Berlin, Germany,
2014-05-06 11:28

Posting: # 12917
Views: 4,975

 df peculiarities for 4x4 crossover and EMA [General Sta­tis­tics]

Dear all,

for higher order designs with more than one treatment the EMA guideline recommends us to use only the data relevant for the comparison under consideration.

My (seems too) naive attempt for obtaining the degrees of freedom (df) of the corresponding ANOVA (without a further decomposition of the subject effect into sequence and subject nested within sequence) for a 4x4 crossover was:

source  df
total   2N-1  (2*N values for a pair)
tmt      1    (2 treatments a pair)
period   3    (4 periods, no recoding)
subject N-1
MSerr   N-4

Looks correct?

But on the output of my SAS dragon for a 4x4 study with 12 subjects and the sequences (Williams design, A=T1, B=T2, C=T3, D=R)

I see the following df for the pairs:
      A vs D
      C vs D  B vs D
tmt     1       1
period  3       2
Mserr   8       9


Any idea what's going on here?



Berlin, Germany,
2014-05-07 11:43

@ d_labes
Posting: # 12921
Views: 4,363

 df peculiarities for 4x4 crossover and EMA - follow-up

Dear all,

Follow up 07May:

What does R gives us as answer? Function lm() used:
      A vs D
      C vs D  B vs D
tmt      1       1
period   3       3
subject 11      10
Mserr    8       9

Seem again a case that the R geeks have a different opinion as SAS. More and more I are convinced that statistics is more an art then sciences :-D.


Vienna, Austria,
2014-05-07 16:49

@ d_labes
Posting: # 12923
Views: 4,370

 Mirror, mirror on the wall…

Dear Detlew,

» Seem again a case that the R geeks have a different opinion as SAS.

Fascinating. 12 subjects, your sequences, EMA all fixed effects, “irrelevant treatments” excluded in Phoenix/WinNonlin:
                        A vs D
                        C vs D              B vs D
Hypothesis       Numer_DF Denom_DF   Numer_DF Denom_DF
int                   1        8          1        9
treatment             1        8          1        9
period                3        8          3        9
sequence              3        8          2        9
sequence*subject      8        8          8        9

» More and more I are convinced that statistics is more an art then sciences :-D.

Beyond my intellectual reach. What’s going on here? Three pieces of software treat B/D differently from A/D and C/D.

Edit: Combinatorial playground. The cells of our pairwise comparisons are:

  A/D        C/D        B/D  
───────    ───────    ───────
• D • A    C D • •    • D B •
D A • •    D • C •    D • • B
• • A D    • C • D    B • • D
A • D •    • • D C    • B D •
───────    ───────    ───────

OK – balanced as expected.

Now a little bit shuffled:

  A/D        C/D        B/D  
───────    ───────    ───────
· · A D    C D · ·    · B D ·
D A · ·    · · D C    · D B ·
───────    ───────    ───────
A D ·    · C D    B • • D
· D A    D C ·    D • • B
───────    ───────    ───────

In the upper half of each square treatments immediately follow each other. In the lower half of A/D and C/D they are separated by one excluded treatment – but in B/D they are separated by two

   All animals are equal,
but some animals are
more equal than others.
   George Orwell (Animal Farm, 1945)

Helmut Schütz

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes

Berlin, Germany,
2014-05-08 09:18

@ Helmut
Posting: # 12928
Views: 4,302

 … Snow White or Little Red Riding Hood?

Dear Helmut,

» Beyond my intellectual reach ...

Me too.

I have fiddled a little bit with the expected sequence-by-period means and intra-subject contrasts (A,B,C,D are the treatment effects, p1... p4 the period effects):
              pair B/D
       P1    P2    P3    P4      ISC
CDBA    /   D+p2  B+p3   /    (B-D) + (p3-p2)
DACB  D+p1    /     /   B+p4  (B-D) + (p4-p1)
BCAD  B+p1    /     /   D+p4  (B-D) - (p4-p1)
ABDC    /   B+p2  D+p3    /   (B-D) - (p3-p2)

Ups! In this parametrization we really have one treatment' parameter and only 2 for the period'.

The pair f.i. A/D is left to you :cool:.
It has one treatment parameter (df=1) and 4 period' parameters which sum to zero (translates into df=3?).



2014-05-08 00:52

@ d_labes
Posting: # 12926
Views: 4,348

 model matrix and lexer

Hi all,

I am somewhat sure this is an issue with the lexer and the way it constructs the model matrix.

Just a bad quick example, it is 1 AM and grandpa is jetlagged and tired....

Model = lm(foobar~Hötzi+Detlew)

Let's say Hötzi has three levels, like Nuts, completely Nuts, and completely utterly Nuts, Detlew has two levels like light smoker and heavy smoker.

Since we want an intercept we can at most have a model matrix with 6 columns. Since we fit with an intercept the first col will regularly just be a bunch of ones. If the lexer reads the fixed effects "from behind" then we will have 1 column for Detlew (one for light smoker, perhaps) followed by two for Helmut.
The solution gives one value for intercept, one for the factor called Detlew, and two for Hötzi.
If the lexer does it the other way around then we get one for intercept, 2 for Hötzi and one for Detlew.
Both are correct.

In the case with four trt's we could be interested in the effects of a trt for which the lexer rand out of (some) df's. It is a question of who-comes-first, really.

I could be wrong, but...
Best regards,

Berlin, Germany,
2014-05-08 08:38

@ ElMaestro
Posting: # 12927
Views: 4,350

 model matrix and lexer

Dear Ol'Pirate!

You really mean that the solution depends on the order of the effects in the model? :confused:
Just a quick check:
My above cited df's in R were obtained with
lm(log(AUC)~ tmt + period + subject, data=pair).
Now applying
lm(log(AUC)~ subject + tmt + period, data=pair)
       A vs D
       C vs D  B vs D
 subject 11      11
 tmt      1       1
 period   3       2
 Mserr    8       9

Seems you are correct! But IMHO this is not a good behavior.

BTW: R and SAS now coincide althoug in SAS the equivalent of the first lm() call was used.
The question is left: Why to hell are the df's different between the pairs?


 Thread view
Bioequivalence and Bioavailability Forum |  Admin contact
19,537 posts in 4,144 threads, 1,338 registered users;
online 8 (0 registered, 8 guests [including 8 identified bots]).
Forum time (Europe/Vienna): 01:09 CEST

When puzzled, it never hurts to read the primary documents –
a rather simple and self-evident principle that has, nonetheless,
completely disappeared from large sectors
of the American experience.    Stephen Jay Gould

BEBAC Ing. Helmut Schütz