ps.geneJAM | R Documentation |
This function generates polygenic scores (PSs) by fitting a univariate simple linear regression model for each feature x on each outcome component y.
ps.geneJAM(x, y)
x |
Input matrix, of dimension nobs x nvars; each row is an observation vector. Can be in sparse matrix format. |
y |
Quantitative response matrix, of dimension nobs x nouts. |
For each outcome component Y_l we fit a univariate simple linear regression on the form
Y_l = X_j B_{jl} + E_l,
where the scalar B_{jl} is a regression coefficient E_l is is a vector of length nobs of independent Gaussian random errors. For a multivariate outcome Y we define the PS for each outcome component l = 1,...,q and each individual i = 1,...,N by
PS_{il} = ∑_{j=1}^p X_{ij}\hat{B}_{jl},
where \hat{B}_{jl} is the maximum likelihood estimate of B_{jl}.
An object of class "ps.geneJAM" is returned.
PS |
A matrix of dimension nobs x nouts of polygenic scores. |
N <- 500 # q <- 10 # p <- 20 # set.seed(1) x <- matrix(rbinom(n = N*p, size = 2, prob = 0.3), nrow=N, ncol=p) B <- matrix(0, nrow = p, ncol = q) B[1, 1:2] <- 2 y <- x %*% B + matrix(rnorm(N*q), nrow = N, ncol = q) ### ps <- ps.geneJAM(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.