Fits a radial inverse variance weighted (IVW) model using a range of weighting specifications. Outliers are determined with respect to their contribution to global heterogeneity, quantified by Cochran's Q-statistic, using a significance threshold specified by the user. The ivw_radial function returns an object of class "IVW", containing effect estimates, total estimated heterogeneity using Cochran's Q-statistic, the individual contribution to overall heterogeneity of each variant, and a data frame for used in the downstream plotting functions plot_radial and plotly_radial.
Arguments
- r_input
A formatted data frame using the
format_radialfunction, or an object of classMRInputgenerated byMendelianRandomization::mr_inputor a data.frame for a single exposure-outcome pair generated byTwoSampleMR::harmonise_data.- alpha
A value specifying the statistical significance threshold for identifying outliers (
0.05specifies a p-value threshold of 0.05).- weights
A value specifying the inverse variance weights used to calculate IVW estimate and Cochran's Q statistic. By default modified second order weights are used, but one can choose to select first order (
1), second order (2) or modified second order weights (3).- tol
A value indicating the tolerance threshold for performing the iterative IVW approach. The value represents the minimum difference between the coefficients of the previous and current iterations required for a further iteration to be performed (default=
0.0001).- summary
A logical argument (
TRUEorFALSE) indicating whether a summary of results and heterogeneity should be presented (default=TRUE).
Value
An object of class "IVW" containing the following components:
coefThe estimated coefficient, its standard error, t-statistic and corresponding (two-sided) p-value.
qstatisticCochran's Q statistic for overall heterogeneity.
dfDegrees of freedom. This is equal to the number of variants -1 when fitting the radial IVW model.
outliersA data frame containing variants identified as outliers, with respective Q statistics, chi-squared tests and SNP identification.
dataA data frame containing containing SNP IDs, inverse variance weights, the product of the inverse variance weight and ratio estimate for each variant, contribution to overall heterogeneity with corresponding p-value, and a factor indicator showing outlier status.
confintA vector giving lower and upper confidence limits for the radial IVW effect estimate.
it.coefThe estimated iterative coefficient, its standard error, t-statistic and corresponding (two-sided) p-value.
it.confintA vector giving lower and upper confidence limits for the iterative radial IVW effect estimate.
fe.coefThe estimated fixed effect exact coefficient, its standard error, t-statistic and corresponding (two-sided) p-value.
fe.confintA vector giving lower and upper confidence limits for the fixed effect exact radial IVW effect estimate.
re.coefThe estimated random effect exact coefficient, its standard error, t-statistic and corresponding (two-sided) p-value.
re.confintA vector giving lower and upper confidence limits for the random effect exact radial IVW effect estimate.
mfThe mean F statistic for the set of genetic variants, indicative of instrument strength.
References
Bowden, J., et al., Improving the visualization, interpretation and analysis of two-sample summary data Mendelian randomization via the Radial plot and Radial regression. International Journal of Epidemiology, 2018. 47(4): p. 1264-1278.
Examples
# Example using format_radial data
ldl.dat <- data_radial[data_radial[,10]<5e-8,]
ldl.fdat <- format_radial(ldl.dat[,6], ldl.dat[,9],
ldl.dat[,15], ldl.dat[,21], ldl.dat[,1])
ivw_radial(ldl.fdat, 0.05, 1, 0.0001, TRUE)
#>
#> Radial IVW
#>
#> Estimate Std.Error t value Pr(>|t|)
#> Effect (1st) 0.4874900 0.05830409 8.361163 6.210273e-17
#> Iterative 0.4873205 0.05827885 8.361874 6.172955e-17
#> Exact (FE) 0.4958973 0.03804168 13.035630 7.673061e-39
#> Exact (RE) 0.4910400 0.05690039 8.629818 4.287681e-13
#>
#>
#> Residual standard error: 1.544 on 81 degrees of freedom
#>
#> F-statistic: 69.91 on 1 and 81 DF, p-value: 1.46e-12
#> Q-Statistic for heterogeneity: 193.0843 on 81 DF , p-value: 3.827332e-11
#>
#> Outliers detected
#> Number of iterations = 3
# Example using TwoSampleMR format data
if (FALSE) { # \dontrun{
if (require("TwoSampleMR", quietly = TRUE)) {
# Example with one exposure-outcome pair
bmi_exp_dat <- TwoSampleMR::extract_instruments(outcomes = 'ieu-a-2')
chd_out_dat <- TwoSampleMR::extract_outcome_data(
snps = bmi_exp_dat$SNP,
outcomes = 'ieu-a-7')
tsmrdat <- TwoSampleMR::harmonise_data(exposure_dat = bmi_exp_dat,
outcome_dat = chd_out_dat)
ivw_radial(r_input = tsmrdat, alpha = 0.05,
weights = 1, tol = 0.0001, summary = TRUE)
}
} # }
# Example using MendelianRandomization format data
if (require("MendelianRandomization", quietly = TRUE)) {
dat <- data_radial[data_radial[,10] < 5e-8,]
mrdat <- MendelianRandomization::mr_input(bx = dat$ldlcbeta,
bxse = dat$ldlcse,
by = dat$chdbeta,
byse = dat$chdse,
snps = dat$rsid)
ivw_radial(r_input = mrdat, alpha = 0.05,
weights = 1, tol = 0.0001, summary = TRUE)
}
#>
#> Radial IVW
#>
#> Estimate Std.Error t value Pr(>|t|)
#> Effect (1st) 0.4874900 0.05830409 8.361163 6.210273e-17
#> Iterative 0.4873205 0.05827885 8.361874 6.172955e-17
#> Exact (FE) 0.4958973 0.03804168 13.035630 7.673061e-39
#> Exact (RE) 0.4910400 0.05317545 9.234338 2.731149e-14
#>
#>
#> Residual standard error: 1.544 on 81 degrees of freedom
#>
#> F-statistic: 69.91 on 1 and 81 DF, p-value: 1.46e-12
#> Q-Statistic for heterogeneity: 193.0843 on 81 DF , p-value: 3.827332e-11
#>
#> Outliers detected
#> Number of iterations = 3