[R-sig-ME] Bivariate MCMCglmm with uneven number of repeats

Jarrod Hadfield j@h@d||e|d @end|ng |rom ed@@c@uk
Fri Sep 9 16:18:13 CEST 2022


Hi Lou,

Doing the analyses the way you have done - long format  - is statistically should and should give exactly the same answer as a wide format data set padded with NA’s. However, the long-format method is computationally more efficient, especially when the number of repeats is highly uneven between the traits.

MCMCglmm should have accepted the wide format and padded NA’s, however - could you send me code/data/error-message so I can take a look?

Cheers,

Jarrod

> On 9 Sep 2022, at 12:12, Louc Yates <louc.yates22 using gmail.com> wrote:
>
> This email was sent to you by someone outside the University.
> You should only click on links or attachments if you are certain that the email is genuine and the content is safe.
>
> Dear list,
>
> I would like to test for covariation between two traits, aggression (count
> data, poisson distribution) and glucocorticoids (gaussian), using a
> bivariate MCMCglmm.
>
> During data collection, aggression assays were conducted immediately after
> collection of samples for glucocorticoids. However, additional
> glucocorticoid samples were also collected without any aggression assays
> being collected. Therefore, I have more glucocorticoid values than I do
> aggression scores. If possible, I would like to include all
> glucocorticoid values,
> rather than just the samples that were collected at the same time
> aggression assays were performed.
>
> I have tried running a bivariate MCMCglmm using a wide data frame, where
> each row contains an aggression and glucocorticoid value (both collected at
> the same time) and the remaining glucocorticoid values on rows that contain
> an NA where the paired aggression data should be. However, MCMCglmm will
> not run models using this data format as it does not accept NAs.
>
> I have also restructured my data to a long/stacked format, where each row
> contains information on a single trait (similar to the data structure
> needed for the 'covu' method) and the model runs successfully and the
> diagnostics look fine.
>
> My question is: is running a bivariate model with an uneven number of
> repeats for either trait statistically 'sound'? Am I unknowingly violating
> any assumptions? I only ask as I have not run bivariate models using this
> data structure before and want to make sure it is fine to do it this way.
>
> Best wishes
> Lou
>
>
> In case this provides any useful info, below is an example of my prior
> specification and model structure.
>
> prior <- list(G = list(G1 = list(V = diag(2), nu = 1.002), *#2-way var-cov
> matrix of IndividualID for AGGRESSION + CORT*
>                                  G2 = list(V = diag(1), nu = 0.002), *#rand
> effect for TestChamber (fitted for AGGRESSION)*
>                                  G3 = list(V = diag(1), nu = 0.002),*#rand
> effect for BirthYear (fitted for CORT)*
>                                  G4 = list(V = diag(1), nu = 0.002)), *#rand
> effect for LabID (CORT)*
>                     R = list(R1 = list(V = diag(2), nu = 1.002)))  *#2-way
> var-cov matrix of resid for AGGRESSION + CORT*
>
>
> m1<- MCMCglmm(Aggression.CORT.data ~ variable - 1 +
> at.level(variable, "AGGRESSION"):rescale(Sex) +
> at.level(variable, "AGGRESSION"):rescale(Age_years) +
> at.level(variable, "CORT"):rescale(Age_years),
> random = ~us(variable):IndividualID +
> us(at.level(variable,"AGGRESSION")):TestChamber+
> us(at.level(variable,"CORT")):BirthYear+
> us(at.level(variable,"CORT")):LabID,
> rcov = ~idh(variable):units,
> family = NULL, # specified already in the data
> prior = prior,
> nitt=5000000,
> burnin=50000,
> thin=500,
> verbose = FALSE,
> pr=FALSE,
> data = data)
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.


More information about the R-sig-mixed-models mailing list