make.moments2: Build matrix of second moments from subject-specific data.

Description Usage Arguments Details Value Author(s) Examples

View source: R/moments2.R

Description

Performs input checking, flipping of coded and noncoded alleles, removal of individuals with missing data, constructs a subject-specific data matrix X, and returns X'X.

Usage

1
make.moments2(params, phenolist, snpdata, weightvar)

Arguments

params

a data frame, see gtx.params.

phenolist

a list of phenotypic response variables and covariates to be included in addition to genetic variables from params.

snpdata

a list with snpinfo and data, see snpdata.

weightvar

name of a variable in snpdata$data containing individual weights when approximating the likelihood for GLMs.

Details

After extracting the necessary columns, any rows (individuals) with any missing data are removed.

Value

A numeric matrix of second moments.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
data(mthfrex)
xtx <- make.moments2(mthfr.params, c("SBP", "DBP", "SexC", "Age"), mthfrex)

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.