Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

approx_mult_prod

Approximate the covariance of a set of predictors and a product of responses


Description

approx_mult_prod recursively estimates the covariances and means of a set of responses. Estimates are approximated using all unique response orderings and aggregated.

Usage

approx_mult_prod(
  means,
  covs,
  n,
  response,
  predictors,
  responses,
  verbose = FALSE
)

Arguments

means

a vector of predictor and response means with all response means at the end of the vector.

covs

covariance matrix of all predictors and responses with column and row order corresponding to the order of means.

n

sample size (an integer).

response

a string. Currently supports "binary" or "continuous".

predictors, responses

lists of objects of class predictor where each entry corresponds to one predictor/response variable.

verbose

logical.

Value

A list containing the following elements:

means

a vector of the (approximated) means of all predictors and the product of responses

covs

a matrix of (approximated) covariances between all predictors and the product of responses

References

Wolf JM, Westra J, Tintle N (2021). “Using summary statistics to evaluate the genetic architecture of multiplicative combinations of initially analyzed phenotypes with a flexible choice of covariates.” bioRxiv. doi: 10.1101/2021.03.08.433979, https://www.biorxiv.org/content/10.1101/2021.03.08.433979v1.


pcsstools

Tools for Regression Using Pre-Computed Summary Statistics

v0.1.1
GPL (>= 3)
Authors
Jack Wolf [aut, cre, cph] (<https://orcid.org/0000-0002-8919-8740>), R Core Team and contributors worldwide [cph, aut] (Author and copyright holder of modified 'stats' fragments)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.