# [R-sig-ME] How to analyze a 2x2 crossover with baseline in R?

Emmanuel Curis emmanuel.curis at parisdescartes.fr
Sat Jun 8 17:32:49 CEST 2013

```Hello,

I have to test for the effect of a treatment in a crossover design
with the two sequences TP/PT (T = treatment, P = placebo), but with
also a single baseline measurement, before period 1. Sample data are
given at the end of this message.

I can do the analysis without the baseline measurement, but when I try
to include in it in the model, lme fails with the message

> lme( X7_SRF ~ Traitement + Periode, random = ~ 1|Numero,
data = donnees,
control = list( msVerbose = TRUE ) )
Erreur dans MEEM(object, conLin, control\$niterEM) :
Singularité rencontrée en résolution inverse au niveau 0, bloc 1

which should be in English something like « Error in MEEM(...).
Singularity encountred when backsolving at level 0, bloc 1 ».

lmer also fails complaing for a non-definite matrix.

I guess this is related to the fact that period J0 is confounded with
treatment = Baseline, as seen in

> with( donnees, table( Periode, Traitement ) )
Traitement
Periode Baseline Treatment Placebo
J0       16         0       0
M1        0         8       8
M2        0         8       7

as may also suggest the fact that not using both Periode and
Traitement makes lme succeeds.

But how to write the model to fit, trying to reproduce the whole
time-evolution of the patient outcome knowing the time and the
condition? Does it make sense anyway, or fit periode 1 vs baseline and
period 2 vs periode 1 the only way to to something?

When I use lm, using the patient as a fixed effect, it seems to work
(some coefficients are NA, in agreement with the above problem I
guess), and results suggests there is no period or sequence effect,
especially if considering
but I am not very satisfied with it...

> anova( lm( X7_SRF ~ Traitement + Periode + Sequence + Numero,
data = donnees ) ) )
Analysis of Variance Table

Response: X7_SRF
Df Sum Sq Mean Sq F value  Pr(>F)
Traitement  2 106533   53266    4,36 0,02248 *
Periode     1  10721   10721    0,88 0,35694
Sequence    1   2542    2542    0,21 0,65182
Numero     14 829085   59220    4,85 0,00019 ***
Residuals  28 342135   12219

Same thing using aov, but there is a (slight) unbalance since one
patient leaved before the end, so how far can it be trusted?

> summary( aov( X7_SRF ~ Traitement + Periode + Sequence + Error(Numero),
data = donnees ) ) )
Error: Numero
Df Sum Sq Mean Sq F value Pr(>F)
Traitement  1  79638   79638    1,36   0,27
Sequence    1     24      24    0,00   0,98
Residuals  13 763423   58725

Error: Within
Df Sum Sq Mean Sq F value Pr(>F)
Traitement  2 101121   50561    4,14  0,027 *
Periode     1   4673    4673    0,38  0,541
Residuals  28 342135   12219

The data:
> donnees
X7_SRF Periode Sequence Traitement Numero
1     548      J0 Groupe A   Baseline      1
2     351      M1 Groupe A  Treatment      1
3     418      M2 Groupe A    Placebo      1
4     300      J0 Groupe A   Baseline     10
5     180      M1 Groupe A  Treatment     10
6     153      M2 Groupe A    Placebo     10
7     652      J0 Groupe A   Baseline     11
8     638      M1 Groupe A  Treatment     11
10    491      J0 Groupe B   Baseline     12
11    488      M1 Groupe B    Placebo     12
12    443      M2 Groupe B  Treatment     12
13    376      J0 Groupe B   Baseline     14
14    466      M1 Groupe B    Placebo     14
15    447      M2 Groupe B  Treatment     14
16    638      J0 Groupe A   Baseline     15
17    628      M1 Groupe A  Treatment     15
18    872      M2 Groupe A    Placebo     15
19    459      J0 Groupe A   Baseline     16
20    191      M1 Groupe A  Treatment     16
21    206      M2 Groupe A    Placebo     16
22    731      J0 Groupe B   Baseline     17
23    536      M1 Groupe B    Placebo     17
24    584      M2 Groupe B  Treatment     17
25    462      J0 Groupe B   Baseline      2
26    373      M1 Groupe B    Placebo      2
27    400      M2 Groupe B  Treatment      2
28    197      J0 Groupe B   Baseline      3
29    291      M1 Groupe B    Placebo      3
30    160      M2 Groupe B  Treatment      3
31    768      J0 Groupe B   Baseline      4
32    260      M1 Groupe B    Placebo      4
33    238      M2 Groupe B  Treatment      4
34    606      J0 Groupe A   Baseline      5
35    629      M1 Groupe A  Treatment      5
36    350      M2 Groupe A    Placebo      5
37    424      J0 Groupe A   Baseline      6
38    304      M1 Groupe A  Treatment      6
39    439      M2 Groupe A    Placebo      6
40    538      J0 Groupe A   Baseline      7
41    511      M1 Groupe A  Treatment      7
42    501      M2 Groupe A    Placebo      7
43    524      J0 Groupe B   Baseline      8
44    601      M1 Groupe B    Placebo      8
45    298      M2 Groupe B  Treatment      8
46    511      J0 Groupe B   Baseline      9
47    513      M1 Groupe B    Placebo      9
48    444      M2 Groupe B  Treatment      9

--
Emmanuel CURIS
emmanuel.curis at parisdescartes.fr

Page WWW: http://emmanuel.curis.online.fr/index.html

```