Learn R Programming

lit (version 1.0.0)

marginal: Marginal (SQ/CP) approach

Description

The marginal function performs a trait-by-trait univariate test for latent interactions using the squared residuals and cross products.

Usage

marginal(y, x, adjustment = NULL, pop_struct = NULL)

Value

A data frame of p-values where the columns are the cross products/squared residuals and the rows are SNPs.

Arguments

y

matrix of traits (n observations by k traits)

x

matrix of SNPs (n observations by m SNPs)

adjustment

matrix of covariates to adjust traits

pop_struct

matrix of PCs that captures population structure

See Also

marginal_plink

Examples

Run this code
# set seed
set.seed(123)

# Generate SNPs and traits
X <- matrix(rbinom(10*2, size = 2, prob = 0.25), ncol = 2)
Y <- matrix(rnorm(10*4), ncol = 4)

out <- marginal(Y, X)

Run the code above in your browser using DataLab