standard error for heritability estimates

92 views
Skip to first unread message

kidd...@gmail.com

unread,
Mar 4, 2021, 4:24:59 AM3/4/21
to R/qtl2 discussion
Hello Karl,

I was wondering if it possible to work out standard error for heritability from est_herit or is there some other way to estimate how confident we can be about the heritability estimate.

Thanks

Senthil

Karl Broman

unread,
Mar 4, 2021, 9:00:04 AM3/4/21
to R/qtl2 discussion
I’ve not looked at this. Seems like you could use equation 2 from Visscher and Goddard (2015),  which just depends on eigenvalues of kinship matrix, sample size, and heritability. Or use a “parametric bootstrap” (simulate multivariate normal data with the estimated covariance matrix). 

karl

Karl Broman

unread,
Mar 4, 2021, 10:46:03 AM3/4/21
to R/qtl2 discussion

# estimated SE of estimated heritability
# Visscher & Goddard (2015), https://doi.org/10.1534/genetics.114.171017
#
# lambda_i = eigenvalues of kinship matrix
# a = sum[ (lam_i-1)^2 / (1 + h^2(lam_i - 1))^2 ]
# b = sum[ (lam_i - 1) / (1 + h^2(lam_i - 1)) ]
# N = sample size
#
# var(h_hat^2) = 2 / (a - b^2/N)

se_herit <-
    function(pheno, kinship)
{

    h2 <- as.numeric(est_herit(pheno, kinship))

    d <- decomp_kinship(kinship)

    lam <- d$values
    a <- sapply(h2, function(hsq) sum( (lam-1)^2 / (1 + hsq*(lam-1))^2 ) )
    b <- sapply(h2, function(hsq) sum( (lam-1) / (1 + hsq*(lam-1)) ) )
    n <- length(lam)

    setNames( sqrt(2 / (a - b^2/n)), colnames(pheno) )
}

kidd...@gmail.com

unread,
Mar 4, 2021, 5:55:05 PM3/4/21
to R/qtl2 discussion
Hello Karl,

Thanks a lot for the quick answer and putting together code.
Will run it on some data and let you know how it goes.

Thanks

Senthil

Reply all
Reply to author
Forward
0 new messages