-
Notifications
You must be signed in to change notification settings - Fork 9
/
mrmodalplot.sthlp
105 lines (81 loc) · 3.84 KB
/
mrmodalplot.sthlp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{smcl}
{* *! version 0.1.0 2aug2017 Tom Palmer}{...}
{vieweralsosee "mrrobust" "mrrobust"}{...}
{viewerjumpto "Syntax" "mrmodalplot##syntax"}{...}
{viewerjumpto "Description" "mrmodalplot##description"}{...}
{viewerjumpto "Examples" "mrmodalplot##examples"}{...}
{viewerjumpto "References" "mrmodalplot##references"}{...}
{viewerjumpto "Author" "mrmodalplot##author"}{...}
{title:Title}
{p 5}
{bf:mrmodalplot} {hline 2} Density plot to investigate values of phi in mrmodal
{p_end}
{marker syntax}{...}
{title:Syntax}
{p 8 16 2}
{opt mrmodalplot} {var:_gd} {var:_gdse} {var:_gp} {var:_gpse} {ifin}
[{cmd:,} {it:options}]
{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{synopt :{opt lc:(optlist)}}list of line {help colorstyle:colors}{p_end}
{synopt :{opt lp:(optlist)}}list of line {help linepatternstyle:patterns}{p_end}
{synopt :{opt lw:(optlist)}}list of line {help linewidthstyle:widths}{p_end}
{synopt :{opt nome:}}NOME assumption{p_end}
{synopt :{opt phi:(numlist)}}value/s of phi (for bandwidth), default is .25 .5 1{p_end}
{synopt :{opt reps:(#)}}number of bootstrap replications to obtain standard error{p_end}
{synopt :{opt seed:(#)}}seed for random number generator for bootstrapping to
obtain standard error{p_end}
{synopt :{opt weight:ed}}weighted IV estimates{p_end}
{p2col:{cmd:*}}Other options passed to the {cmd:twoway} plot{p_end}
{marker description}{...}
{title:Description}
{pstd}
{cmd:mrmodalplot} plots the density of the IV estimates used in the {help mrmodal} estimator.
{pstd}
{var:_gd} is a variable containing the genotype-disease (SNP-outcome) association estimates.
{pstd}
{var:_gdse} is a variable containing the genotype-disease (SNP-outcome) association estimate
standard errors.
{pstd}
{var:_gp} is a variable containing the genotype-phenotype (SNP-exposure) association
estimates.
{pstd}
{var:_gpse} is a variable containing the genotype-phenotype (SNP-exposure) association
estimate standard errors.
{pstd}
Note that in Stata 18.0 the default legend position of a twoway plot was changed from the 6 o'clock position to the 3 o'clock position.
In Stata 18.0 and above {cmd:mrmodalplot} resets the default back to 6 o'clock (which can be overridden with, for example, {cmd:legend(pos(12))}).
{marker examples}{...}
{title:Examples}
{pstd}Using the data provided by {help mrmodalplot##do:Do et al. (2013)} recreate
{help mrmodalplot##bowden:Bowden et (2016)}, Figure 4,
LDL-c "All genetic variants" (plot in row 2, column 1).{p_end}
{pstd}Setup{p_end}
{phang2}{cmd:.} {stata "use https://raw.github.com/remlapmot/mrrobust/master/dodata, clear"}{p_end}
{pstd}Select observations ({it:p}-value with exposure < 10^-8){p_end}
{phang2}{cmd:.} {stata "gen byte sel1 = (ldlcp2 < 1e-8)"}{p_end}
{pstd}Densities with phi=.25, .5, 1 and reproducible standard error{p_end}
{phang2}{cmd:.} {stata "mrmodalplot chdbeta chdse ldlcbeta ldlcse if sel1==1, seed(12345)"}{p_end}
{pstd}Densities with phi=.4, .6, .8, 1 and reproducible standard error{p_end}
{phang2}{cmd:.} {stata "mrmodalplot chdbeta chdse ldlcbeta ldlcse if sel1==1, phi(.4(.2)1) seed(12345)"}{p_end}
{pstd}Lines in grayscale and reproducible standard error{p_end}
{phang2}{cmd:.} {stata "mrmodalplot chdbeta chdse ldlcbeta ldlcse if sel1==1, lc(gs10 gs5 gs0) seed(12345)"}{p_end}
{marker references}{...}
{title:References}
{marker bowden}{...}
{phang}
Bowden J, Davey Smith G, Haycock PC, Burgess S. Consistent estimation in
Mendelian randomization with some invalid instruments using a weighted median
estimator. Genetic Epidemiology, 2016, 40, 4, 304-314.
{browse "https://dx.doi.org/10.1002/gepi.21965":DOI}
{p_end}
{marker do}{...}
{phang}
Do et al. Common variants associated with plasma triglycerides and risk
for coronary artery disease. Nature Genetics, 2013, 45, 1345-1352.
{browse "https://dx.doi.org/10.1038/ng.2795":DOI}
{p_end}
{marker author}{...}
{title:Author}
INCLUDE help mrrobust-author