Description Usage Arguments Details Value Author(s) Examples
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.
1 | lm.moments2(xtx, leftvar, rightvars, n = NULL)
|
xtx |
a matrix of second moments, typically built using |
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. |
Non-identifiable variables in rightvars
are removed, with
preference for keeping variables that occur earlier rather than later
in rightvars
.
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
.
Toby Johnson Toby.x.Johnson@gsk.com
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.