iv_free: IV-free exposure

View source: R/nlme_summ_aes.r

iv_freeR Documentation

IV-free exposure

Description

iv_free computes the IV-free exposure.

Usage

iv_free(y, x, g, covar = NULL, q = 10, family = "gaussian", controlsonly = T)

Arguments

y

vector of outcome values.

x

vector of exposure values.

g

the instrumental variable.

covar

a matrix of covariates.

q

the number of quantiles the exposure distribution is to be split into. The default is deciles (i.e. 10 quantiles).

family

a description of the error distribution and link function to be used in the model (either "gaussian" or "binomial" can be specified).

controlsonly

whether to estimate the gx association in all people, or in controls only. This is set to TRUE by default, but has no effect if family is gaussian.

Value

xcoef

the association between the exposure and the instrument

x0

the IV-free exposure.

x0q

the quantiles of x0.

Author(s)

Amy Mason am2609@medschl.cam.ac.uk based on similar function in nlmr by James R Staley


amymariemason/SUMnlmr documentation built on July 22, 2024, 10:03 a.m.