compute_univariate_sumstats: Compute summary statistics from univariate simple linear...

View source: R/compute_covs.R

compute_univariate_sumstatsR Documentation

Compute summary statistics from univariate simple linear regression.

Description

Function to compute regression coefficients and their standard errors from univariate simple linear regression.

Usage

compute_univariate_sumstats(
  X,
  Y,
  standardize = FALSE,
  standardize.response = FALSE,
  mc.cores = 1
)

Arguments

X

n x p matrix of covariates.

Y

n x r matrix of responses.

standardize

If TRUE, X is "standardized" using the sample means and sample standard deviations.

standardize.response

If TRUE, Y is "standardized" using the sample means and sample standard deviations.

mc.cores

Number of cores to use. Parallelization is done over responses.

Value

A list with following elements:

Bhat

p x r matrix of the regression coeffcients.

Shat

p x r matrix of the standard errors for regression coeffcients.


stephenslab/mr.mash.alpha documentation built on Feb. 7, 2025, 10:06 p.m.