Understanding multivariate model with cov_ranef argument

307 views
Skip to first unread message

Luke Holman

unread,
Apr 11, 2018, 10:12:43 PM4/11/18
to brms-users
Hi there,

I've been trying out brms for a couple of days for quantitative genetic analysis, and I love it! I have a fairly simple stats/brms -related question that someone can hopefully help with.

So, I have a load of highly inbred fruitfly lines, which have had their whole genomes sequenced, allowing construction of a genetic similarity matrix specifying how closely related each line is to each other line. Let's call it the GRM (genomic relatedness matrix).

I have measured multiple phenotypic traits on all the lines, and obtained an estimate of the average phenotype of each line. For simplicity let's stick to the bivariate case, and call them trait1 and trait2. 

I would like to estimate the proportion of variance in trait1 and trait2 that is explained by genetics, and the proportion of covariance between the traits that is explained by genetics (i.e. the heritability and the genetic correlation). Basically, I want to know if genetically similar lines are also phenotypically similar, and to estimate whether genes that positively affect trait1 also tend to affect trait2 (and is the effect on trait2 positive or negative).

My first attempt was a model like this:

brms(cbind(trait1, trait2) ~ (1 | line), cov_ranef = list(line = GRM))

As I understand it, the output of this model contains estimates of:

A. the SD of the line intercepts for trait 1 and trait 2 ("Group-level effects")
B. the estimated intercepts for trait1 and trait2 ("Population-level effects")
C. the variance of the residuals in traits 1 and 2 (the sigma terms in "Family specific parameters")
D. the correlation between the residuals of traits 1 and 2 (the rescor term in "Family specific parameters")

I think I can calculate heritability as A / (A + C), the variance explained by line divided by the total variance (i.e. variance explained by line plus the residual variance). 

Where I get a bit unsure is in calculating the genetic correlation. There is no term for the covariance explained by line, so I cannot use the same A / (A + C) approach. I thought maybe I could just use the covariance between the raw values of trait1 and trait2, which I guess is equivalent to the total variance, but this is possibly wrong (e.g. because it doesn't incorporate uncertainty in our estimation of the total variance?).

So, I then tried the model:

brms(cbind(trait1, trait2) ~ (1 | p | line), cov_ranef = list(line = GRM))

Based on the vignette for multivariate models, which says: "By writing |p| in between we indicate that all varying effects of [line] should be modeled as correlated." I find this sentence confusing, but I infer that it means that we are 'telling' the model to use the data to estimate the correlation between line effects on trait1 and trait2, and make sure all the line effects estimated by the model take values that give that correlation across lines.

But I'm confused now. Doesn't the cov_ranef argument already specify the covariance in line effects? What does the model do when we tell it to estimate that covariance using the | p | notation, and also tell it to use a specific covariance structure using the cov_ranef argument?

The second model does give me the correlation between line intercepts for traits 1 and 2 in the "Group-level effects" section, but I don't know if what I'm doing is meaningful.

Thanks very much for reading, and for the fantastic R package!

Best wishes,

Luke

Paul Buerkner

unread,
Apr 14, 2018, 6:10:49 AM4/14/18
to Luke Holman, brms-users
cov_ranef species the correlation / covariance between different levels of the **same** random effect. For instance for line of trait1.

By using |p| you model the effects of the same grouping level (one level of line) as correlated **across** random effects (line of trait1 with line of trait2).

So they are modelling different things of which both are reasonable and imply something different.

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/d86f1c4f-6d4a-4b71-a778-f74664101d49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages