lin_associations: Calculates the linear association between a matrix of...

lin_associationsR Documentation

Calculates the linear association between a matrix of features A and a vector y.

Description

Calculates the linear association between a matrix of features A and a vector y.

Usage

lin_associations(
  X,
  Y,
  W = NULL,
  n.min = 4,
  shrinkage = T,
  alpha = 0,
  MHC_direction = NULL
)

Arguments

X

n x m numerical matrix of features (missing values are allowed).

Y

n x p numerical matrix of responses (missing values are allowed)

W

n x p numerical matrix of confounders (missing values are not allowed).

n.min

Numeric value controlling the minimum degrees of freedom required for p-values.

shrinkage

Boolean to control whether adaptive shrinkage should be applied.

alpha

Numeric value controling the alpha value for adaptive shrinkage.

MHC_direction

String ("x" or "y") indicating which variable is independent, defaults to matrix with more columns.

Value

A list with components:

N

Vector of degrees of freedom for each feature.

rho

Vector of uncorrected beta estimates controlled for W.

beta

Vector of corrected beta estimates controlled for W.

beta.se

Vector of standard errors of the beta estimates.

p.val

Vector of p-values (without adaptive shrinkage).

q.val

Vector of q-values (without adaptive shrinkage).

res.table

A table with the following columns (values calculated with adaptive shrinkage):
betahat: estimated linear coefficient controlled for W.
sebetahat: standard error for the estimate of beta.
NegativeProb: posterior probabilities that beta is negative.
PositiveProb: posterior probabilities that beta is positive
lfsr: local and global FSR values.
svalue: s-values.
lfdr: local and global FDR values.
qvalue: q-values for the effect size estimates.
PosteriorMean: moderated effect size estimates.
PosteriorSD: standard deviations of moderated effect size estimates.
dep.var: dependent variables (column names of Y).
ind.var: independent variables (column names of X).


broadinstitute/cdsr_models documentation built on Aug. 9, 2022, 10:36 a.m.