make.inter: Making Design Matrix of Interactions (GxG and GxE)

View source: R/make.inter.r

make.interR Documentation

Making Design Matrix of Interactions (GxG and GxE)

Description

This function is to construct a design matrix of interactions from two main-effect design matrices.

Usage

make.inter(x1, x2, back = 0)  

Arguments

x1, x2

design matrices of main-effect predictors.

back

For GxE interactions, back = 0. For the Cockerham and codominant GxG models, back = 1, and for other GxG models, back = 0. if back = 1, interaction between rs123a and rs123d is not allowed. This is only need for the Cockerham and codominant models, because they defines two main effects for each marker.

Value

This function returns a data.frame consisting of values of all interaction predictors.

Author(s)

Nengjun Yi, nyi@uab.edu

See Also

make.main

Examples

library(BhGLM)

x = sim.x(n=100, m=10, genotype=6:10)
geno = x[, 6:10] #get genotype data
cov1 = x[, 1, drop=F] #get the first covariate

x.main = make.main(geno=geno, model="Cockerham", fill.missing=T)
x.GE = make.inter(x.main, cov1, back=0) #interactions between cov1 and all main effects
x.GG1 = make.inter(x.main[, 1:4], x.main[, 5:10], back=1) # some GxG interactions 
x.GG2 = make.inter(x.main, x.main, back=1) # all GxG interactions 


nyiuab/BhGLM documentation built on June 12, 2024, 9:28 p.m.