matrixQTL_with_mask_two_dim: Solve Y = X1 b1 + X2 b2 + e with mask in matrix form

Description Usage Arguments Value Examples

View source: R/rlib_matrix_ls_with_mask.R

Description

For each column i in X, solve Y_k = X_1i b_1i + X_2i b_2i + e with M_k as mask (entries with M_k = 0 are excluded) as least squares problem and output estimated effect size and standard deviation

Usage

1

Arguments

Y

response to regress against (dimension = N x K)

X1

P predictors (as the first predictor) perform regression separately (dimension = N x P)

X2

P predictors (as the second predictor) to perform regression separately (dimension = N x P)

M

mask for regression of Y_k (dimension = N x K)

Value

a list of summary statistics beta1_hat: estimated b1, b1_hat (dimension = K x P) beta1_se: standard deviation of b1_hat (dimension = K x P) beta2_hat: estimated b2, b2_hat (dimension = K x P) beta2_se: standard deviation of b2_hat (dimension = K x P)

Examples

1
2
3
4
5
6
matrixQTL_with_mask_two_dim(
  Y = matrix(rnorm(300), ncol = 3),
  X1 = matrix(sample(c(0, 0.5, 1), 200, replace = TRUE), ncol = 2),
  X2 = matrix(sample(c(0, 0.5, 1), 200, replace = TRUE), ncol = 2),
  M = matrix(sample(c(0, 1), 300, replace = TRUE), ncol = 3)
)

liangyy/mixqtl documentation built on Sept. 17, 2020, 11:36 a.m.