d_labes
★★★

Berlin, Germany,
2014-05-06 13:28
(3614 d 11:19 ago)

Posting: # 12917
Views: 6,661
 

 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)
CDBA
DACB
BCAD
ABDC

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

:confused:

Any idea what's going on here?

Regards,

Detlew
d_labes
★★★

Berlin, Germany,
2014-05-07 13:43
(3613 d 11:03 ago)

@ d_labes
Posting: # 12921
Views: 5,749
 

 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.

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2014-05-07 18:49
(3613 d 05:58 ago)

@ d_labes
Posting: # 12923
Views: 5,880
 

 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 (each treatment occurs one in each period and the order is twice TR and RT ).

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)

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
d_labes
★★★

Berlin, Germany,
2014-05-08 11:18
(3612 d 13:28 ago)

@ Helmut
Posting: # 12928
Views: 5,670
 

 … 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?).

Regards,

Detlew
ElMaestro
★★★

Denmark,
2014-05-08 02:52
(3612 d 21:54 ago)

@ d_labes
Posting: # 12926
Views: 5,767
 

 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.

Pass or fail!
ElMaestro
d_labes
★★★

Berlin, Germany,
2014-05-08 10:38
(3612 d 14:08 ago)

@ ElMaestro
Posting: # 12927
Views: 5,756
 

 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)
gives:
       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?

Regards,

Detlew
UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,636 registered users;
84 visitors (0 registered, 84 guests [including 12 identified bots]).
Forum time: 23:47 CET (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5