From: Thierry Onkelinx <thierry.onkelinx at inbo.be>
Sent: Friday, October 25, 2019 10:30:47 AM
To: Julian Gaviria Lopez
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] About computing covariances between two fixed effects with 4 and 5 levels respectively.
Dear Julian,
The described covariance structures relate to a _random_ effect. You are looking for _fixed_ effect covariances.
You are probably looking for a model like glmmTMB(Observations ~ CAP * Condition + (1|ID), data=sdf, ziformula=~1)
I'd also recommend to contact a local statistician about your problem.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx at inbo.be<mailto:thierry.onkelinx at inbo.be>
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be<http://www.inbo.be>
///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////
[https://inbo-website-prd-532750756126.s3-eu-west-1.amazonaws.com/inbologoleeuw_nl.png]<https://www.inbo.be>
Op do 24 okt. 2019 om 15:05 schreef Julian Gaviria Lopez <Julian.GaviriaLopez at unige.ch<mailto:Julian.GaviriaLopez at unige.ch>>:
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<http://fit.us> <- glmmTMB(Observations ~ us(CAP + 0 | Condition), data=sdf, ziformula=~1)
I obtain the following result:
> VarCorr(fit.us<http://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 at unige.ch<mailto:Julian.GaviriaLopez at unige.ch>
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models at r-project.org<mailto:R-sig-mixed-models at r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models