3

Let's take the Pixel dataset as example.

Grouped Data: pixel ~ day | Dog/Side
    Dog Side day  pixel
1     1    R   0 1045.8
2     1    R   1 1044.5
3     1    R   2 1042.9

pixel is the response. Dog with 10 levels. Side with 2 levels. day with 9 levels. I want to fit a model where the covariance matrix is the direct(kronecker) product between the 10x10 identity Dog matrix, 2x2 identity Side matrix, a the 9x9 AR1 day matrix.

So should it be something like

lme(pixel~1,corr=corAR1(form~1|Dog/Side),weights=varIdent(form=~1|Dog*Side),data=Pixel)

But here I have got a nesting structure between Dog and Side in the corr term. Although this is correct for this dataset, I want it to be cross Dog:Side in general. Furthermore, I am not sure the different components corr and weights will be combined together using direct product internal of lme.

p.s. I understand this dataset is not balanced, so not all 10x2x9=180 combinations are present. But I still need the direct product structure in general, perhaps suitably adjusted for the missing levels.

qoheleth
  • 2,219
  • 3
  • 18
  • 23

0 Answers0