calcvar: Variance of estimator

Description Usage Arguments Details Value Examples

View source: R/powercalc.R

Description

Calculation of variance of estimator and residual degrees of freedom

Usage

1
calcvar(lambda, eigendec, n, weights = 1)

Arguments

lambda

shrinkage parameter

eigendec

eigenvalue decomposition of (p x p) correlation matrix R

n

sample size

weights

vector (LEN p) of SNP-specific weights or scalar if weights are equal for all SNPs; default value 1

Details

The variance of estimator beta (regression coefficient of SNP-BLUP approach) and the residual degrees of freedom are calculated based on the eigenvalue decomposition of correlation matrix R

Value

df

residual degrees of freedom

var.beta

vector (LEN p) of variance of estimator beta up to a constant (i.e. residual variance / n)

Examples

1
2
3
4
  ### correlation matrix (should depend on sire haplotypes)
  R <- AR1(100, rho = 0.1)
  eigendec <- eigen(R)
  out <- calcvar(1200, eigendec, 100)

hscovar documentation built on April 13, 2021, 9:06 a.m.

Related to calcvar in hscovar...