Learn R Programming

GEint (version 1.1)

GE_BICS: GE_BICS.R

Description

A function to perform inference on the GxE interaction regression coefficient. Shows better small sample performance than comparable methods.

Usage

GE_BICS(outcome, design_mat, num_boots = 1000, desired_coef,
  outcome_type, check_singular = FALSE)

Value

The p-value for the interaction effect

Arguments

outcome

The outcome vector

design_mat

The design matrix of covariates

num_boots

The number of bootstrap resamples to perform - we suggest 1000

desired_coef

The column in the design matrix holding the interaction covariate

outcome_type

Either 'D' for dichotomous outcome or 'C' for continuous outcome

check_singular

Make sure the design matrix can be inverted for variance estimation

Examples

Run this code
E <- rnorm(n=500)
G <- rbinom(n=500, size=2, prob=0.3)
design_mat <- cbind(1, G, E, G*E)
outcome <- rnorm(500)
GE_BICS(outcome=outcome, design_mat=design_mat, desired_coef=4, outcome_type='C')

Run the code above in your browser using DataLab