[R-sig-ME] About computing covariances between two fixed effects with 4 and 5 levels respectively.
Julian Gaviria Lopez
Ju||@n@G@v|r|@Lopez @end|ng |rom un|ge@ch
Thu Oct 24 15:05:33 CEST 2019
Hello,
I want to assess the correlation of 4 kinds of brain activation patterns (CAP: c1, c2, c3, c4) from 20 subjects, across 5 different conditions (Condition: base, neu, pneu, aff, paff). In total, the count data contains 380 observations, and has the next structure:
ID Observations CAP Condition
1 6 c1 base
... ... ... ...
20 0 c1 base
... ... ... ...
1 3 c4 base
... ... ... ...
20 0 c4 base
1 4 c1 neu
... ... ... ...
20 2 c1 neu
... ... ... ...
1 0 c4 neu
... ... ... ...
20 5 c4 neu
... ... ... ...
20 0 c4 paff
I am trying to compute the covariance structures proposed by Kasper Kristensen:
https://cran.r-project.org/web/packages/glmmTMB/vignettes/covstruct.html
When I compute the unstructured covariance:
> fit.us <- glmmTMB(Observations ~ us(CAP + 0 | Condition), data=sdf, ziformula=~1)
I obtain the following result:
> VarCorr(fit.us)
Conditional model:
Groups Name Std.Dev. Corr
Condition c1 0.86527
c2 0.34487 0.116
c3 0.16450 -0.951 0.164
c4 0.36269 0.414 -0.719 -0.545
Residual 1.98011
As you might appreciate, the results are either wrong or uncompleted, since the right output would yield a 5x4 cov matrix, expressing the correlation of the CAPs (c1, c2, c3, c4) across all the conditions (base, neu, pneu, aff, paff). One rapid solution is to compute the cov matrix per condition. However, apart of being penalized by model deficiency (I guess), the problem is still present, since the question to answer is how the brain activation patterns (CAP) are correlated across all conditions (e.g. correlation between "CAP c1 - Condition aff", and "CAP c4 - Condition paff").
Thanks in advance for any comment on this regard.
Best,
Julian Gaviria
Neurology and Imaging of cognition lab (Labnic)
University of Geneva. Campus Biotech.
9 Chemin des Mines, 1202 Geneva, CH
Tel: +41 22 379 0380
Email: Julian.GaviriaLopez using unige.ch
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list