coef.mr.ash: Extract Regression Coefficients from Mr.ASH Fit

coef.mr.ashR Documentation

Extract Regression Coefficients from Mr.ASH Fit

Description

Retrieve posterior mean estimates of the regression coefficients in a Mr.ASH model.

Usage

## S3 method for class 'mr.ash'
coef(object, ...)

Arguments

object

A Mr.ASH fit, usually the result of calling mr.ash.

...

Additional arguments passed to the default S3 method.

Value

A p+1 vector. The first element gives the estimated intercept, and the remaining p elements are the estimated regression coefficients.

## generate synthetic data set.seed(1) n = 200 p = 300 X = matrix(rnorm(n*p),n,p) beta = double(p) beta[1:10] = 1:10 y = X

## fit mr.ash fit.mr.ash = mr.ash(X, y)

## coefficient coef.mr.ash = coef(fit.mr.ash) intercept = coef.mr.ash[1] beta = coef.mr.ash[-1]


stephenslab/mr.ash.alpha documentation built on Oct. 31, 2023, 4:21 p.m.