Learn R Programming

MendelianRandomization (version 0.10.0)

weighted.median.boot.se: 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)

Value

Causal estimate.

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.

Examples

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

Run the code above in your browser using DataLab