Skip to contents

r_g = cov(a@t1, a@t2) / sqrt(var(a@t1) var(a@t2)), read by parameter NAME. rg() gives the point only. Its standard error by the delta method comes from se_function(), which reads the covariance of the components in fit$vcov: se_function(fit, function(th) th[["cov(animal@y2,animal@y1)"]] / sqrt(th[["var(animal@y1)"]] * th[["var(animal@y2)"]])). Near r_g = +/-1 that standard error has no meaning: the likelihood there is not a parabola.

Usage

rg(fit, term = "animal", t1 = NULL, t2 = NULL)

Arguments

fit

result of model_mt()

term

name of the term (for example "animal")

t1

name of the first trait

t2

name of the second

Value

a single number, the genetic correlation. Its standard error comes from se_function(), as above.

Details

A fit that did not converge is read at its last iterate, with a warning; when the fit reports the information matrix SINGULAR along a set of components that includes one of the two variances or the covariance, the correlation is returned as NA, with a warning naming the components, and so is a fit with no estimates.