stepdown.moments2: Stepwise downward model selection using summary statistic...

Description Usage Arguments Details Value Author(s) Examples

Description

Terms are dropped iteratively from a regression model until the reduction of improvement in fit (judged by the P-value for a partial t-test or score test) is signicant at a specified threshold. The method implemented here makes use of a pre-built sufficient summary statistic matrix, which contains the (weighted) second moments between all the variables that are being assessed for inclusion in the regression model. The calculations are exact for a normal linear model and correspond to a score test for a generalised linear model.

Usage

1
2
stepdown.moments2(xtwx, leftvar, biggest, smallest,
                p.thresh = 0.05, n = NULL, vscale = NULL)

Arguments

xtwx

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

leftvar

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

biggest

name(s) of the explanatory variables in the biggest model to fit, i.e.\ variables to consider for inclusion.

smallest

name(s) of the explanatory variables in the smallest model to fit, i.e.\ variables that must be included.

p.thresh

P-value threshold for proceeding to add a term to the model.

n

sample size, only needed for the normal linear model if there is not a single intercept “ONE” for all individuals.

vscale

parameter, set to NULL for normal linear model and 1 for logistic regression.

Details

This performs stepwise downward model selection. Significance of terms considered for inclusion is determined using identical calculations to lm.moments2 and est.moments2.

When the vscale argument is NULL this function assumes that the xtwx argument was calculated with unit weights and therefore that a linear model fit is required with error variance estimated from the data.

When the vscale argument is set equal to 1 this function assumes that the xtwx argument was calculated with weights calculated such that a correct likelihood function can be recovered and therefore that a generalised linear model fit is required.

Values other than NULL or 1 for the vscale parameter may not be what you think. Do not use other values unless you are absolutely sure that you understand what are doing. See the manuscript for details.

Value

The fitted model, as returned by calling lm.moments2 or est.moments2. This is a list with slots for the effect size estimates, standard errors, and a precision matrix.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
6
data(mthfrex)
xtx <- make.moments2(mthfr.params, c("SBP", "DBP", "SexC", "Age"), mthfrex)
allsnps <- paste(mthfr.params$snp, mthfr.params$coded.allele, sep = "_")
myfit <- stepdown.moments2(xtx, "SBP", allsnps, c("ONE", "SexC", "Age"))
## much faster than stepAIC but only steps to bigger models
cbind(beta = myfit$betahat, se = myfit$se, t = myfit$beta/myfit$se)

Example output

Loading required package: survival
Dropping rs17421462_G P-value = 0.993 
Dropping rs12121543_C P-value = 0.943 
Dropping rs9651118_T P-value = 0.882 
Dropping rs5065_G P-value = 0.874 
Dropping rs1009591_T P-value = 0.869 
Dropping rs4846049_T P-value = 0.861 
Dropping rs6668659_T P-value = 0.884 
Dropping rs198388_T P-value = 0.823 
Dropping rs13306558_T P-value = 0.816 
Dropping rs198375_T P-value = 0.721 
Dropping rs1801131_T P-value = 0.705 
Dropping rs7535669_G P-value = 0.701 
Dropping rs2066463_T P-value = 0.645 
Dropping rs17376426_T P-value = 0.634 
Dropping rs2066466_T P-value = 0.59 
Dropping rs1931226_C P-value = 0.587 
Dropping rs3753583_G P-value = 0.538 
Dropping rs12562819_G P-value = 0.538 
Dropping rs6541007_G P-value = 0.561 
Dropping rs17037425_G P-value = 0.492 
Dropping rs2274976_T P-value = 0.46 
Dropping rs1413355_T P-value = 0.451 
Dropping rs2066470_G P-value = 0.447 
Dropping rs5064_G P-value = 0.374 
Dropping rs1801133_G P-value = 0.359 
Dropping rs34840945_G P-value = 0.325 
Dropping rs868014_G P-value = 0.318 
Dropping rs6694164_T P-value = 0.321 
Dropping rs4846051_G P-value = 0.28 
Dropping rs5227_C P-value = 0.274 
Dropping rs5229_T P-value = 0.272 
Dropping rs198358_T P-value = 0.262 
Dropping rs2066465_T P-value = 0.249 
Dropping rs17037397_C P-value = 0.224 
Dropping rs7525338_T P-value = 0.167 
Dropping rs11802855_T P-value = 0.118 
Dropping rs13306553_G P-value = 0.0944 
Dropping rs5068_G P-value = 0.0863 
Dropping rs198372_G P-value = 0.06 
Dropping rs17375901_T P-value = 0.0606 
Dropping rs7555034_T P-value = 0.0562 
                    beta        se         t
ONE          110.1931342 37.895541  2.907813
SexC          -5.1022999  1.072420 -4.757742
Age            0.3183264  0.111901  2.844713
rs1537514_G   16.8410119  4.525585  3.721289
rs3818762_G   14.9129432  2.010188  7.418681
rs13306556_T -19.5698794  4.627593 -4.228954
rs1476413_T  -12.4331352  2.597824 -4.785981
rs1994798_G    3.9919299  1.187325  3.362120
rs17421511_G -18.8726973  3.014396 -6.260856
rs4846052_T    6.6284976  1.742221  3.804625
rs17037388_G  -5.8092998  2.500043 -2.323680
rs11121832_T   6.1477959  1.991041  3.087729
rs17037390_G  13.6237356  2.405258  5.664147
rs17037396_T -11.7738169  3.607161 -3.264012
rs17367504_G -11.5052536  2.438761 -4.717663
rs13306561_G  -5.8285741  2.720583 -2.142399
rs13306560_T -17.2103810  6.639754 -2.592021
rs3737964_T  -15.8326222  1.763742 -8.976722
rs17350396_G  14.4289719  2.066664  6.981769
rs14078_G      9.4308889  3.849477  2.449914
rs5063_T      25.6984043  7.361210  3.491057
rs198381_G     5.4733139  2.777182  1.970816
rs1318408_G  -22.7012244  3.265255 -6.952358
rs12562952_T  12.5508022  3.810200  3.294001
rs11801879_T  13.4001764  5.599225  2.393220
rs11803049_G  13.6914841  6.957667  1.967827

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