matrixQTL_with_mask_one_dim: Solve Y = Xb + e with mask and weight 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_i b_i + e with M_k as mask (entries with M_k = 0 are excluded) and observations are weighted by W_k as least squares problem and output estimated effect size and standard deviation

Usage

1
matrixQTL_with_mask_one_dim(Y, X, M, Weight = NULL)

Arguments

Y

response to regress against (dimension = N x K)

X

P predictors to perform regression separately (dimension = N x P)

M

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

Weight

weights for regression of Y_k (dimension = N x K; default = NULL)

Value

a list of summary statistics beta_hat: estimated b, b_hat (dimension = K x P) beta_se: standard deviation of b_hat (dimension = K x P)

Examples

1
2
3
4
5
6
matrixQTL_with_mask_one_dim(
  Y = matrix(rnorm(300), ncol = 3),
  X = matrix(sample(c(0, 0.5, 1), 200, replace = TRUE), ncol = 2),
  M = matrix(sample(c(0, 1), 300, replace = TRUE), ncol = 1),
  Weight = matrix(runif(300), ncol = 3)
)

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