computeVPC.NB: Calculate the negative binomial (NB) variance partition...

Description Usage Arguments Value Examples

View source: R/HeriTools.R

Description

Calculate the NB VPC for one or more features following the model fitting function fit.NB().

Usage

1

Arguments

para

A G x 3 matrix of negative binomial fit parameters for G features, G≥q 1. The column order is intercept α_g, random effect σ_g^2 (σ_g^2≥q0), and dispersion φ (φ>0).

Value

A G x 1 matrix consisting of VPC for G features based on negative binomial mixed model. Column name is "NB-fit"; row names are the feature names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Compute VPC for each feature under negative binomial mixed model.
vpc.nb <- computeVPC.NB(para_nb)

## Visulize the distribution of the VPCs. 
hist(vpc.nb, breaks = 50, col = "cyan")

## Plot sorted VPCs.
plot(sort(vpc.nb), ylab = "Heritability (h2)", ylim = c(0,1), 
main = "Sorted NB VPC scores")
abline(h = 0.9, lty = 2, col = "red")
text(50, 0.92, "h2 = 0.9", col = "red")

HeritSeq documentation built on July 13, 2021, 1:06 a.m.