Title


ivxtile -- Perorm estimation within quantiles of the first stage residuals prefix command

Syntax

ivxtile , par(string) [saving(filename [, replace]) xtile_options]: iv_cmd

options Description ---------------------------------------------------------------------------------------------- par(string) Parameter from the iv_cmd (ivreg2, ivmsmm, ivlsmm, ivtsps, ivtsri) to collect saving(filename [, replace]) Save the within quantile estimation results to a dataset. Specify replace to overwrite an existing dataset trace View the output from the iv_cmd in each quantile xtile_options xtile##options

Description

ivxtile implements the command specified after the prefix within quantiles of the first stage residuals, as per Burgess et al., 2014.

Options

Please see xtile##options

Examples

Simulate data with different outcome-exposure relationships; y# outcome, x exposure, g instrumental variable (genotype).

. use https://raw.github.com/remlapmot/ivonesamplemr/main/data/ivmwdata, clear

Plot outcome-exposure relationships

. twoway line y1 x, sort(x) . twoway line y2 y3 y4 x, sort(x) . twoway line y5 x, sort(x)

Use with different iv commands.

. ivxtile, nq(5) par(x): ivregress 2sls y2 (x = g) . ivxtile, nq(10) par(b1): ivtsps y2 (x = g)

Some binary outcome examples.

. use https://raw.github.com/remlapmot/ivonesamplemr/main/data/ivbinoutdata, clear

. ivxtile, nq(5) par(b1): ivtsps y (x = z1 z2 z3), link(logadd) . ivxtile, nq(5) par(b1): ivtsps y (x = z1 z2 z3), link(logmult) . ivxtile, nq(5) par(b1): ivtsps y (x = z1 z2 z3), link(logit) . ivxtile, nq(5) par(b1): ivtsri y (x = z1 z2 z3), link(logadd) . ivxtile, nq(5) par(b1): ivtsri y (x = z1 z2 z3), link(logmult) . ivxtile, nq(5) par(b1): ivtsri y (x = z1 z2 z3), link(logit) . ivxtile, nq(5) par(x): ivlsmm y (x = z1 z2 z3) . ivxtile, nq(5) par(x): ivmsmm y (x = z1 z2 z3)

Save the dataset of results.

. ivxtile, nq(10) par(x) saving(ivxtileres): ivreg2 y2 (x = g)

Stored results

ivxtile does not store results in either e() or r() but does save the results dataset if the saving() option is specified.

References

Burgess S, Davies N, Thompson SG, EPIC-InterAct Consortium. Instrumental variable analysis with a nonlinear exposure-outcome relationship. Epidemiology, 2014, 25, 6, 877-885. DOI

StataCorp. Stata Base Reference Manual. Release 16. pctile - Creating variable containing percentiles. 2016. URL

Author

INCLUDE help ivonesamplemr-author