sim_stats_mef {DBpower}R Documentation

sim_power_indiv.R

Description

Simulate power starting from individual-level data for multiple explanatory factor setting.

Usage

sim_stats_mef(
  B,
  sigSq,
  xMat,
  gMat,
  alphaVec,
  betaVec,
  decompTrue = NULL,
  checkpoint = FALSE
)

Arguments

B

Number of simulations.

sigSq

Variance of outcome.

xMat

Design matrix of non-genetic covariates, n*p.

gMat

Matrix of genotypes, n*J.

alphaVec

p*1 vector of regression coefficients for xMat.

betaVec

J*1 vector of regression coefficients for gMat.

decompTrue

The return value of a call to eigen() on the true covariance matrix. Can be null, in which case estimated covariance will be used.

checkpoint

Boolean, if true then print message every 50 simulations.

Value

A list with the elements:

zMat

B*J matrix of test statistics Z.

zVecGBJ

Check on Z statistics, vector should match first row of zMat.

iMat

Innovated statistics matrix also of dimension B*J.

Examples


xMat <- cbind(1, rnorm(n = 1000), rbinom(n = 1000, size=1, prob=0.5))
gMat <- matrix(data = rbinom(n=10000, size=2, prob=0.3), nrow=1000)
alphaVec <- c(1, 1, 1)
betaVec <- rep(0, 10)
sim_stats_mef(B=10000, sigSq = 1, xMat = xMat, gMat = gMat, alphaVec = alphaVec, betaVec = betaVec)


[Package DBpower version 0.1.0 Index]