weighted.median.boot.se: Weighted median standard error function

View source: R/mr_median-methods.R

weighted.median.boot.seR Documentation

Weighted median standard error function

Description

Internal function for calculating standard error of weighted median estimate (or simple median estimator if weights are all equal) using bootstrapping. The number of iterations and initial value of the random seed can also be set.

Usage

weighted.median.boot.se(Bx, By, Bxse, Byse, weights, iter, seed)

Arguments

Bx

A numeric vector of beta-coefficient values for genetic associations with the exposure.

By

A numeric vector of beta-coefficient values for genetic associations with the outcome.

Bxse

The standard errors associated with the beta-coefficients in Bx.

Byse

The standard errors associated with the beta-coefficients in By.

weights

Weights.

iter

The number of bootstrap samples to generate when calculating the standard error.

seed

The random seed to use when generating the bootstrap samples (for reproducibility). If set to NA, the random seed will not be set (for example, if the function is used as part of a larger simulation).

Details

None.

Value

Causal estimate.

Examples

weighted.median.boot.se(Bx = ldlc, By = chdlodds, Bxse = ldlcse, Byse = chdloddsse,
weights = chdloddsse, iter = 100, seed = 314)


MendelianRandomization documentation built on Aug. 9, 2023, 1:05 a.m.