Learn R Programming

gtx (version 0.0.8)

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

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

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.

Value

A numeric matrix of second moments.

Details

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

Examples

Run this code
data(mthfrex)
xtx <- make.moments2(mthfr.params, c("SBP", "DBP", "SexC", "Age"), mthfrex)

Run the code above in your browser using DataLab