lm.moments2: Fit normal linear model using pre-built matrix of second...

Description Usage Arguments Details Value Author(s) Examples

Description

Regression coefficients for a normal linear model are be calculated, using a pre-built sufficient summary statistic matrix that contains the second moments between all the variables of (potential) interest.

Usage

1
lm.moments2(xtx, leftvar, rightvars, n = NULL)

Arguments

xtx

a matrix of second moments, typically built using make.moments2.

leftvar

name of the response variable (the left hand side of the formula).

rightvars

name(s) of the explanatory variables (the right hand side of the formula).

n

sample size, only needed if there is not a single intercept for all individuals.

Details

Non-identifiable variables in rightvars are removed, with preference for keeping variables that occur earlier rather than later in rightvars.

Value

A list with slots for the effect size estimates, standard errors, and a precision matrix.

This function is just a wrapper for calling est.moments2 with scale = NULL.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
6
7
8
data(mthfrex)
xtx <- make.moments2(mthfr.params, c("SBP", "DBP", "SexC", "Age"), mthfrex)
lm.moments2(xtx, "SBP", c("ONE", "rs6668659_T", "rs4846049_T",
                                "rs1801133_G", "SexC", "Age"))
## Compare against results from lm
## Note have to use coded alleles in original data
lm(SBP ~ rs6668659_G+rs4846049_G+rs1801133_A+Sex+Age, data = mthfrex$data)
## Note in results Sex factor coded differently than SexC

gtx documentation built on May 2, 2019, 5:08 a.m.