Dear all,
I'm trying to fit a "nested-factorial" model (definition from Montgomery's
design of experiments 5th edition, page 569 and following) with some
hierarchical features and 4 factors, all of which are considered to be
random. I'm working with genomic data so, the entire data matrix is made up
of something like 40000 measurements.

The 4 effects have to be specified as follows:
- Sample is the top-level factor
- Replicate is nested within Sample
- miRNA is crossed with Sample and Replicate
- Spot is nested within miRNA

The model to be fitted should include all possible effects (both main and
interactions):
- Sample
- Replicate in Sample
- miRNA
- Spot in miRNA
- Sample*miRNA
- Sample*(Spot in miRNA)
- miRNA*(Replicate in Sample)
- (Replicate in Sample)*(Spot in miRNA) = residual

I could retrieve the first 5 effects (leaving remaining as residuals) by
fitting this model:

lme1 = lmer(exprs ~ (1|Sample/Replicato) + (1|miRNA/Spot) +
(1|Sample:miRNA), data = miRNA.exprs.ANOVA)
lme1

Linear mixed model fit by REML
Formula: exprs ~ (1 | Sample/Replicato) + (1 | miRNA/Spot) + (1 | Sample:miRNA)
   Data: miRNA.exprs.ANOVA
    AIC    BIC logLik deviance REMLdev
 -82822 -82762  41418   -82842  -82836
Random effects:
 Groups           Name        Variance   Std.Dev.
 Sample:miRNA     (Intercept) 0.02895992 0.170176
 Spot:miRNA       (Intercept) 0.00051016 0.022587
 miRNA            (Intercept) 0.07966632 0.282252
 Replicato:Sample (Intercept) 0.00104631 0.032347
 Sample           (Intercept) 0.00183202 0.042802
 Residual                     0.00480593 0.069325
Number of obs: 40656, groups: Sample:miRNA, 3388; Spot:miRNA, 3388;
miRNA, 847; Replicato:Sample, 12; Sample, 4

Fixed effects:
            Estimate Std. Error t value
(Intercept)  1.70288    0.02546   66.89


However, I was not able to understand how to specify an interaction between
a crossed effect (say Sample) and a nested one (Spot in miRNA), and I
found no useful reference  surfing in the web, and on books on the topic.
Maybe my search was not thorough enough, has anyone some input to give on
this? I attach a short example from the real dataset.

Sample              miRNA Replicato Spot    exprs
1          1 hsa-let-7a-star_st         1    1 1.462398
2          1 hsa-let-7a-star_st         1    2 1.491362
3          1 hsa-let-7a-star_st         1    3 1.505150
4          1 hsa-let-7a-star_st         1    4 1.491362
5          1      hsa-let-7a_st         1    1 2.558709
6          1      hsa-let-7a_st         1    2 2.607455
7          1      hsa-let-7a_st         1    3 2.584331
8          1      hsa-let-7a_st         1    4 2.593286
9          1 hsa-let-7b-star_st         1    1 1.591065
10         1 hsa-let-7b-star_st         1    2 1.623249
11         1 hsa-let-7b-star_st         1    3 1.579784
12         1 hsa-let-7b-star_st         1    4 1.869232
3389       1 hsa-let-7a-star_st         2    1 1.716003
3390       1 hsa-let-7a-star_st         2    2 1.579784
3391       1 hsa-let-7a-star_st         2    3 1.491362
3392       1 hsa-let-7a-star_st         2    4 1.568202
3393       1      hsa-let-7a_st         2    1 2.460898
3394       1      hsa-let-7a_st         2    2 2.385606
3395       1      hsa-let-7a_st         2    3 2.503791
3396       1      hsa-let-7a_st         2    4 2.454845
3397       1 hsa-let-7b-star_st         2    1 1.681241
3398       1 hsa-let-7b-star_st         2    2 1.763428
3399       1 hsa-let-7b-star_st         2    3 1.732394
3400       1 hsa-let-7b-star_st         2    4 1.698970
6777       1 hsa-let-7a-star_st         3    1 1.748188
6778       1 hsa-let-7a-star_st         3    2 1.662758
6779       1 hsa-let-7a-star_st         3    3 1.544068
6780       1 hsa-let-7a-star_st         3    4 1.707570
6781       1      hsa-let-7a_st         3    1 2.698101
6782       1      hsa-let-7a_st         3    2 2.704151
6783       1      hsa-let-7a_st         3    3 2.737193
6784       1      hsa-let-7a_st         3    4 2.668386
6785       1 hsa-let-7b-star_st         3    1 1.698970
6786       1 hsa-let-7b-star_st         3    2 1.785330
6787       1 hsa-let-7b-star_st         3    3 1.857332
6788       1 hsa-let-7b-star_st         3    4 1.643453
10165      2 hsa-let-7a-star_st         1    1 1.531479
10166      2 hsa-let-7a-star_st         1    2 1.447158
10167      2 hsa-let-7a-star_st         1    3 1.568202
10168      2 hsa-let-7a-star_st         1    4 1.544068
10169      2      hsa-let-7a_st         1    1 2.390935
10170      2      hsa-let-7a_st         1    2 2.408240
10171      2      hsa-let-7a_st         1    3 2.374748
10172      2      hsa-let-7a_st         1    4 2.247973
10173      2 hsa-let-7b-star_st         1    1 1.602060
10174      2 hsa-let-7b-star_st         1    2 1.568202
10175      2 hsa-let-7b-star_st         1    3 1.491362
10176      2 hsa-let-7b-star_st         1    4 1.591065
13553      2 hsa-let-7a-star_st         2    1 1.462398
13554      2 hsa-let-7a-star_st         2    2 1.462398
13555      2 hsa-let-7a-star_st         2    3 1.477121
13556      2 hsa-let-7a-star_st         2    4 1.477121
13557      2      hsa-let-7a_st         2    1 2.463893
13558      2      hsa-let-7a_st         2    2 2.626340
13559      2      hsa-let-7a_st         2    3 2.595496
13560      2      hsa-let-7a_st         2    4 2.619093
13561      2 hsa-let-7b-star_st         2    1 1.602060
13562      2 hsa-let-7b-star_st         2    2 1.681241
13563      2 hsa-let-7b-star_st         2    3 1.531479
13564      2 hsa-let-7b-star_st         2    4 1.579784
16941      2 hsa-let-7a-star_st         3    1 1.477121
16942      2 hsa-let-7a-star_st         3    2 1.477121
16943      2 hsa-let-7a-star_st         3    3 1.531479
16944      2 hsa-let-7a-star_st         3    4 1.623249
16945      2      hsa-let-7a_st         3    1 2.592177
16946      2      hsa-let-7a_st         3    2 2.397940
16947      2      hsa-let-7a_st         3    3 2.423246
16948      2      hsa-let-7a_st         3    4 2.571709
16949      2 hsa-let-7b-star_st         3    1 1.698970
16950      2 hsa-let-7b-star_st         3    2 1.612784
16951      2 hsa-let-7b-star_st         3    3 1.556303
16952      2 hsa-let-7b-star_st         3    4 1.716003
20329      3 hsa-let-7a-star_st         1    1 1.531479
20330      3 hsa-let-7a-star_st         1    2 1.491362
20331      3 hsa-let-7a-star_st         1    3 1.568202
20332      3 hsa-let-7a-star_st         1    4 1.505150
20333      3      hsa-let-7a_st         1    1 2.559907
20334      3      hsa-let-7a_st         1    2 2.651278
20335      3      hsa-let-7a_st         1    3 2.660865
20336      3      hsa-let-7a_st         1    4 2.683947
20337      3 hsa-let-7b-star_st         1    1 1.643453
20338      3 hsa-let-7b-star_st         1    2 1.623249
20339      3 hsa-let-7b-star_st         1    3 1.568202
20340      3 hsa-let-7b-star_st         1    4 1.544068
23717      3 hsa-let-7a-star_st         2    1 1.518514
23718      3 hsa-let-7a-star_st         2    2 1.579784
23719      3 hsa-let-7a-star_st         2    3 1.653213
23720      3 hsa-let-7a-star_st         2    4 1.556303
23721      3      hsa-let-7a_st         2    1 2.978637
23722      3      hsa-let-7a_st         2    2 2.969416
23723      3      hsa-let-7a_st         2    3 3.025306
23724      3      hsa-let-7a_st         2    4 2.984077
23725      3 hsa-let-7b-star_st         2    1 1.612784
23726      3 hsa-let-7b-star_st         2    2 1.857332
23727      3 hsa-let-7b-star_st         2    3 1.579784
23728      3 hsa-let-7b-star_st         2    4 1.681241
27105      3 hsa-let-7a-star_st         3    1 1.544068
27106      3 hsa-let-7a-star_st         3    2 1.568202
27107      3 hsa-let-7a-star_st         3    3 1.477121
27108      3 hsa-let-7a-star_st         3    4 1.447158
27109      3      hsa-let-7a_st         3    1 2.844477
27110      3      hsa-let-7a_st         3    2 2.868644
27111      3      hsa-let-7a_st         3    3 2.897077
27112      3      hsa-let-7a_st         3    4 2.868644
27113      3 hsa-let-7b-star_st         3    1 1.732394
27114      3 hsa-let-7b-star_st         3    2 1.653213
27115      3 hsa-let-7b-star_st         3    3 1.568202
27116      3 hsa-let-7b-star_st         3    4 1.518514
30493      4 hsa-let-7a-star_st         1    1 1.518514
30494      4 hsa-let-7a-star_st         1    2 1.414973
30495      4 hsa-let-7a-star_st         1    3 1.447158
30496      4 hsa-let-7a-star_st         1    4 1.447158
30497      4      hsa-let-7a_st         1    1 3.866346
30498      4      hsa-let-7a_st         1    2 3.864214
30499      4      hsa-let-7a_st         1    3 3.856366
30500      4      hsa-let-7a_st         1    4 3.868938
30501      4 hsa-let-7b-star_st         1    1 1.531479
30502      4 hsa-let-7b-star_st         1    2 1.518514
30503      4 hsa-let-7b-star_st         1    3 1.518514
30504      4 hsa-let-7b-star_st         1    4 1.556303
33881      4 hsa-let-7a-star_st         2    1 1.531479
33882      4 hsa-let-7a-star_st         2    2 1.462398
33883      4 hsa-let-7a-star_st         2    3 1.491362
33884      4 hsa-let-7a-star_st         2    4 1.447158
33885      4      hsa-let-7a_st         2    1 3.638589
33886      4      hsa-let-7a_st         2    2 3.709015
33887      4      hsa-let-7a_st         2    3 3.715335
33888      4      hsa-let-7a_st         2    4 3.697752
33889      4 hsa-let-7b-star_st         2    1 1.518514
33890      4 hsa-let-7b-star_st         2    2 1.505150
33891      4 hsa-let-7b-star_st         2    3 1.431364
33892      4 hsa-let-7b-star_st         2    4 1.518514
37269      4 hsa-let-7a-star_st         3    1 1.491362
37270      4 hsa-let-7a-star_st         3    2 1.477121
37271      4 hsa-let-7a-star_st         3    3 1.556303
37272      4 hsa-let-7a-star_st         3    4 1.518514
37273      4      hsa-let-7a_st         3    1 3.746479
37274      4      hsa-let-7a_st         3    2 3.757016
37275      4      hsa-let-7a_st         3    3 3.769525
37276      4      hsa-let-7a_st         3    4 3.760799
37277      4 hsa-let-7b-star_st         3    1 1.556303
37278      4 hsa-let-7b-star_st         3    2 1.491362
37279      4 hsa-let-7b-star_st         3    3 1.518514
37280      4 hsa-let-7b-star_st         3    4 1.447158


Thanks for help

Niccolò

	[[alternative HTML version deleted]]


