diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index 64317ec5..893828c7 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -29,13 +29,13 @@ jobs: matrix: config: - {os: macos-latest, r: 'release'} - - {os: macos-13, r: 'release'} - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'release'} - {os: ubuntu-latest, r: 'oldrel-1'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: '4.3.2'} - - {os: ubuntu-24.04-arm, r: 'release', rspm: 'no' } + - {os: macos-13, r: 'release'} + # - {os: ubuntu-24.04-arm, r: 'release', rspm: 'no' } env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index 2b7c824a..e26e5829 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: TwoSampleMR Title: Two Sample MR Functions and Interface to MRC Integrative Epidemiology Unit OpenGWAS Database -Version: 0.6.13 +Version: 0.6.14 Authors@R: c( person("Gibran", "Hemani", , "g.hemani@bristol.ac.uk", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0920-1055")), diff --git a/NEWS.md b/NEWS.md index f3ad7d97..6312f41c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# TwoSampleMR v0.6.14 + +(Release date 2025-03-28) + +* Minor amends to the `mr_grip()` returned object names (thanks @fdudbridge) +* Fixed some typos in the helpfiles and vignettes + # TwoSampleMR v0.6.13 (Release date 2025-03-26) diff --git a/R/forest_plot2.R b/R/forest_plot2.R index cdc4e69d..7642621a 100644 --- a/R/forest_plot2.R +++ b/R/forest_plot2.R @@ -438,7 +438,7 @@ forest_plot_names <- function(dat, section=NULL, bottom=TRUE) #' #' @param mr_res Results from [mr()]. #' @param exponentiate Convert effects to OR? Default is `FALSE`. -#' @param single_snp_method Which of the single SNP methosd to use when only 1 SNP was used to estimate the causal effect? The default is `"Wald ratio"`. +#' @param single_snp_method Which of the single SNP methods to use when only 1 SNP was used to estimate the causal effect? The default is `"Wald ratio"`. #' @param multi_snp_method Which of the multi-SNP methods to use when there was more than 1 SNPs used to estimate the causal effect? The default is `"Inverse variance weighted"`. #' @param group_single_categories If there are categories with only one outcome, group them together into an "Other" group. The default is `TRUE`. #' @param by_category Separate the results into sections by category? The default is `TRUE`. diff --git a/R/forest_plot_1-to-many.R b/R/forest_plot_1-to-many.R index 4083b492..59072def 100644 --- a/R/forest_plot_1-to-many.R +++ b/R/forest_plot_1-to-many.R @@ -145,7 +145,7 @@ format_1_to_many <- function(mr_res, b="b",se="se",exponentiate=FALSE, ao_slc=FA #' @param sort_action Choose how to sort results. #' \itemize{ #' \item `sort_action = 1`: sort results by effect size within groups. Use the group order supplied by the user. -#' \item `sort_action = 2`: sort results by effect size and group. Overides the group ordering supplied by the user. +#' \item `sort_action = 2`: sort results by effect size and group. Overrides the group ordering supplied by the user. #' \item `sort_action = 3`: group results for the same trait together (e.g. multiple results for the same trait from different MR methods). #' \item `sort_action = 4`: sort by decreasing effect size (largest effect size at top and smallest at bottom). #' \item `sort_action = 5`: sort by increasing effect size (smallest effect size at top and largest at bottom). diff --git a/R/ld.R b/R/ld.R index 65bb6340..74449509 100644 --- a/R/ld.R +++ b/R/ld.R @@ -31,7 +31,7 @@ clump_data <- function(dat, clump_kb=10000, clump_r2=0.001, clump_p1=1, clump_p2 if(!is.data.frame(dat)) { - stop("Expecting data frame returned from format_data") + stop("Expecting data frame returned from format_data().") } if("pval.exposure" %in% names(dat) && "pval.outcome" %in% names(dat)) diff --git a/R/mr-grip.R b/R/mr-grip.R index 3b5f9cbb..75fe932c 100644 --- a/R/mr-grip.R +++ b/R/mr-grip.R @@ -1,6 +1,6 @@ -#' MR-GRIP: a modified MR-Egger model with the Genotype Recoding Invariant Property +#' MR-GRIP: a modified MR-Egger model with the Genotype Recoding Invariance Property #' -#' This implements the modified MR-Egger model with the Genotype Recoding Invariant Property (MR-GRIP) due to Dudbridge and Bowden et al. (2025). +#' This implements the modified MR-Egger model with the Genotype Recoding Invariance Property (MR-GRIP) due to Dudbridge and Bowden et al. (2025). #' It is well known that the results of MR-Egger are sensitive to which alleles are designated as the effect alleles. #' A pragmatic convention is to orient all SNPs to have positive effects on the exposure, which has some advantages in interpretation but also brings some philosophical limitations. #' The MR-GRIP model is a modification to the MR-Egger model in which each term is multiplied by the genotype-phenotype associations. @@ -61,17 +61,17 @@ mr_grip <- function(b_exp, b_out, se_exp, se_out, parameters) { smod <- summary(mod) b <- stats::coefficients(smod)[2, 1] se <- stats::coefficients(smod)[2, 2] - b.adj <- NA - se.adj <- NA - pval.adj <- NA + b.wi <- NA + se.wi <- NA + pval.wi <- NA pval <- 2 * stats::pt(abs(b / se), length(b_exp) - 2L, lower.tail = FALSE) return(list( b = b, se = se, pval = pval, - b.adj = b.adj, - se.adj = se.adj, - pval.adj = pval.adj, + b.wi = b.wi, + se.wi = se.wi, + pval.wi = pval.wi, nsnp = length(b_exp), mod = smod, dat = dat diff --git a/R/multivariable_mr.R b/R/multivariable_mr.R index 3b6b65aa..8059f9e1 100644 --- a/R/multivariable_mr.R +++ b/R/multivariable_mr.R @@ -66,10 +66,10 @@ mv_extract_exposures <- function(id_exposure, clump_r2=0.001, clump_kb=10000, ha #' Note that you can provide an array of column names for each column, which is of length `filenames_exposure` #' #' @param filenames_exposure Filenames for each exposure dataset. Must have header with at least SNP column present. Following arguments are used for determining how to read the filename and clumping etc. -#' @param sep Specify delimeter in file. The default is space, i.e. `sep=" "`. If length is 1 it will use the same `sep` value for each exposure dataset. You can provide a vector of values, one for each exposure dataset, if the values are different across datasets. The same applies to all dataset-formatting options listed below. +#' @param sep Specify delimiter in file. The default is space, i.e. `sep=" "`. If length is 1 it will use the same `sep` value for each exposure dataset. You can provide a vector of values, one for each exposure dataset, if the values are different across datasets. The same applies to all dataset-formatting options listed below. #' @param phenotype_col Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value `"Outcome"`. Default is `"Phenotype"`. #' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`. -#' @param beta_col Required for MR. Name of column with effect sizes. THe default is `"beta"`. +#' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`. #' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`. #' @param eaf_col Required for MR. Name of column with effect allele frequency. The default is `"eaf"`. #' @param effect_allele_col Required for MR. Name of column with effect allele. Must be "A", "C", "T" or "G". The default is `"effect_allele"`. diff --git a/R/other_formats.R b/R/other_formats.R index 3f57a154..b459fd89 100644 --- a/R/other_formats.R +++ b/R/other_formats.R @@ -72,7 +72,7 @@ dat_to_MRInput <- function(dat, get_correlations=FALSE, pop="EUR") #' Harmonise LD matrix against summary data #' -#' LD matrix returns with rsid_ea_oa identifiers. Make sure that they are oriented to the same effect allele as the summary dataset. Summary dataset can be exposure dataset or harmonised dartaset. +#' LD matrix returns with rsid_ea_oa identifiers. Make sure that they are oriented to the same effect allele as the summary dataset. Summary dataset can be exposure dataset or harmonised dataset. #' #' @param x Exposure dataset or harmonised dataset #' @param ld Output from [ld_matrix()] diff --git a/R/read_data.R b/R/read_data.R index b0bbc250..faf4f56b 100644 --- a/R/read_data.R +++ b/R/read_data.R @@ -5,10 +5,10 @@ #' #' @param filename Filename. Must have header with at least SNP column present. #' @param snps SNPs to extract. If `NULL`, which the default, then doesn't extract any and keeps all. -#' @param sep Specify delimeter in file. The default is space, i.e. `sep=" "`. +#' @param sep Specify delimiter in file. The default is space, i.e. `sep=" "`. #' @param phenotype_col Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value `"Outcome"`. Default is `"Phenotype"`. #' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`. -#' @param beta_col Required for MR. Name of column with effect sizes. THe default is `"beta"`. +#' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`. #' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`. #' @param eaf_col Required for MR. Name of column with effect allele frequency. The default is `"eaf"`. #' @param effect_allele_col Required for MR. Name of column with effect allele. Must be "A", "C", "T" or "G". The default is `"effect_allele"`. @@ -64,7 +64,7 @@ read_outcome_data <- function(filename, snps=NULL, sep=" ", phenotype_col="Pheno #' #' @param filename Filename. Must have header with at least SNP column present. #' @param clump Whether to perform LD clumping with [clump_data()] on the exposure data. The default is `FALSE`. -#' @param sep Specify delimeter in file. The default is a space, i.e. `" "`. +#' @param sep Specify delimiter in file. The default is a space, i.e. `" "`. #' @param phenotype_col Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value "Outcome". The default is `"Phenotype"`. #' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`. #' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`. diff --git a/R/steiger.R b/R/steiger.R index 86f4c6cf..875c4955 100644 --- a/R/steiger.R +++ b/R/steiger.R @@ -9,7 +9,7 @@ #' \describe{ #' \item{vz}{Total volume of the error parameter space} #' \item{vz0}{Volume of the parameter space that gives the incorrect answer} -#' \item{vz1}{Volume of the paramtere space that gives the correct answer} +#' \item{vz1}{Volume of the parameter space that gives the correct answer} #' \item{sensitivity_ratio}{Ratio of vz1/vz0. Higher means inferred direction is less susceptible to measurement error} #' \item{pl}{plot of parameter space} #' } @@ -92,7 +92,7 @@ steiger_sensitivity <- function(rgx_o, rgy_o, ...) #' \item{steiger_test_adj}{p-value for inference of direction of causality for given measurement error parameters} #' \item{vz}{Total volume of the error parameter space} #' \item{vz0}{Volume of the parameter space that gives the incorrect answer} -#' \item{vz1}{Volume of the paramtere space that gives the correct answer} +#' \item{vz1}{Volume of the parameter space that gives the correct answer} #' \item{sensitivity_ratio}{Ratio of vz1/vz0. Higher means inferred direction is less susceptible to measurement error} #' \item{sensitivity_plot}{Plot of parameter space of causal directions and measurement error} #' } @@ -223,7 +223,7 @@ directionality_test <- function(dat) #' \item{steiger_test_adj}{p-value for inference of direction of causality for given measurement error parameters} #' \item{vz}{Total volume of the error parameter space} #' \item{vz0}{Volume of the parameter space that gives the incorrect answer} -#' \item{vz1}{Volume of the paramtere space that gives the correct answer} +#' \item{vz1}{Volume of the parameter space that gives the correct answer} #' \item{sensitivity_ratio}{Ratio of vz1/vz0. Higher means inferred direction is less susceptible to measurement error} #' \item{sensitivity_plot}{Plot of parameter space of causal directions and measurement error} #' } diff --git a/man/forest_plot.Rd b/man/forest_plot.Rd index 50eeeccf..dcf515da 100644 --- a/man/forest_plot.Rd +++ b/man/forest_plot.Rd @@ -25,7 +25,7 @@ forest_plot( \item{exponentiate}{Convert effects to OR? Default is \code{FALSE}.} -\item{single_snp_method}{Which of the single SNP methosd to use when only 1 SNP was used to estimate the causal effect? The default is \code{"Wald ratio"}.} +\item{single_snp_method}{Which of the single SNP methods to use when only 1 SNP was used to estimate the causal effect? The default is \code{"Wald ratio"}.} \item{multi_snp_method}{Which of the multi-SNP methods to use when there was more than 1 SNPs used to estimate the causal effect? The default is \code{"Inverse variance weighted"}.} diff --git a/man/harmonise_ld_dat.Rd b/man/harmonise_ld_dat.Rd index 3d70fc1f..1fbf4934 100644 --- a/man/harmonise_ld_dat.Rd +++ b/man/harmonise_ld_dat.Rd @@ -15,5 +15,5 @@ harmonise_ld_dat(x, ld) List of exposure dataset and harmonised LD matrix } \description{ -LD matrix returns with rsid_ea_oa identifiers. Make sure that they are oriented to the same effect allele as the summary dataset. Summary dataset can be exposure dataset or harmonised dartaset. +LD matrix returns with rsid_ea_oa identifiers. Make sure that they are oriented to the same effect allele as the summary dataset. Summary dataset can be exposure dataset or harmonised dataset. } diff --git a/man/mr_grip.Rd b/man/mr_grip.Rd index b5b3f235..5f153a54 100644 --- a/man/mr_grip.Rd +++ b/man/mr_grip.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/mr-grip.R \name{mr_grip} \alias{mr_grip} -\title{MR-GRIP: a modified MR-Egger model with the Genotype Recoding Invariant Property} +\title{MR-GRIP: a modified MR-Egger model with the Genotype Recoding Invariance Property} \usage{ mr_grip(b_exp, b_out, se_exp, se_out, parameters) } @@ -32,7 +32,7 @@ List of with the following elements: } } \description{ -This implements the modified MR-Egger model with the Genotype Recoding Invariant Property (MR-GRIP) due to Dudbridge and Bowden et al. (2025). +This implements the modified MR-Egger model with the Genotype Recoding Invariance Property (MR-GRIP) due to Dudbridge and Bowden et al. (2025). It is well known that the results of MR-Egger are sensitive to which alleles are designated as the effect alleles. A pragmatic convention is to orient all SNPs to have positive effects on the exposure, which has some advantages in interpretation but also brings some philosophical limitations. The MR-GRIP model is a modification to the MR-Egger model in which each term is multiplied by the genotype-phenotype associations. diff --git a/man/mr_steiger.Rd b/man/mr_steiger.Rd index 1039e333..a0854074 100644 --- a/man/mr_steiger.Rd +++ b/man/mr_steiger.Rd @@ -38,7 +38,7 @@ List with the following elements: \item{steiger_test_adj}{p-value for inference of direction of causality for given measurement error parameters} \item{vz}{Total volume of the error parameter space} \item{vz0}{Volume of the parameter space that gives the incorrect answer} -\item{vz1}{Volume of the paramtere space that gives the correct answer} +\item{vz1}{Volume of the parameter space that gives the correct answer} \item{sensitivity_ratio}{Ratio of vz1/vz0. Higher means inferred direction is less susceptible to measurement error} \item{sensitivity_plot}{Plot of parameter space of causal directions and measurement error} } diff --git a/man/mr_steiger2.Rd b/man/mr_steiger2.Rd index bf21b91b..45cb1ede 100644 --- a/man/mr_steiger2.Rd +++ b/man/mr_steiger2.Rd @@ -34,7 +34,7 @@ List with the following elements: \item{steiger_test_adj}{p-value for inference of direction of causality for given measurement error parameters} \item{vz}{Total volume of the error parameter space} \item{vz0}{Volume of the parameter space that gives the incorrect answer} -\item{vz1}{Volume of the paramtere space that gives the correct answer} +\item{vz1}{Volume of the parameter space that gives the correct answer} \item{sensitivity_ratio}{Ratio of vz1/vz0. Higher means inferred direction is less susceptible to measurement error} \item{sensitivity_plot}{Plot of parameter space of causal directions and measurement error} } diff --git a/man/mv_extract_exposures_local.Rd b/man/mv_extract_exposures_local.Rd index 3ceb175c..595ea553 100644 --- a/man/mv_extract_exposures_local.Rd +++ b/man/mv_extract_exposures_local.Rd @@ -35,13 +35,13 @@ mv_extract_exposures_local( \arguments{ \item{filenames_exposure}{Filenames for each exposure dataset. Must have header with at least SNP column present. Following arguments are used for determining how to read the filename and clumping etc.} -\item{sep}{Specify delimeter in file. The default is space, i.e. \code{sep=" "}. If length is 1 it will use the same \code{sep} value for each exposure dataset. You can provide a vector of values, one for each exposure dataset, if the values are different across datasets. The same applies to all dataset-formatting options listed below.} +\item{sep}{Specify delimiter in file. The default is space, i.e. \code{sep=" "}. If length is 1 it will use the same \code{sep} value for each exposure dataset. You can provide a vector of values, one for each exposure dataset, if the values are different across datasets. The same applies to all dataset-formatting options listed below.} \item{phenotype_col}{Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value \code{"Outcome"}. Default is \code{"Phenotype"}.} \item{snp_col}{Required name of column with SNP rs IDs. The default is \code{"SNP"}.} -\item{beta_col}{Required for MR. Name of column with effect sizes. THe default is \code{"beta"}.} +\item{beta_col}{Required for MR. Name of column with effect sizes. The default is \code{"beta"}.} \item{se_col}{Required for MR. Name of column with standard errors. The default is \code{"se"}.} diff --git a/man/read_exposure_data.Rd b/man/read_exposure_data.Rd index 42e77e5b..56873351 100644 --- a/man/read_exposure_data.Rd +++ b/man/read_exposure_data.Rd @@ -33,7 +33,7 @@ read_exposure_data( \item{clump}{Whether to perform LD clumping with \code{\link[=clump_data]{clump_data()}} on the exposure data. The default is \code{FALSE}.} -\item{sep}{Specify delimeter in file. The default is a space, i.e. \code{" "}.} +\item{sep}{Specify delimiter in file. The default is a space, i.e. \code{" "}.} \item{phenotype_col}{Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value "Outcome". The default is \code{"Phenotype"}.} diff --git a/man/read_outcome_data.Rd b/man/read_outcome_data.Rd index 30f1d8ff..4e8879d1 100644 --- a/man/read_outcome_data.Rd +++ b/man/read_outcome_data.Rd @@ -33,13 +33,13 @@ read_outcome_data( \item{snps}{SNPs to extract. If \code{NULL}, which the default, then doesn't extract any and keeps all.} -\item{sep}{Specify delimeter in file. The default is space, i.e. \code{sep=" "}.} +\item{sep}{Specify delimiter in file. The default is space, i.e. \code{sep=" "}.} \item{phenotype_col}{Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value \code{"Outcome"}. Default is \code{"Phenotype"}.} \item{snp_col}{Required name of column with SNP rs IDs. The default is \code{"SNP"}.} -\item{beta_col}{Required for MR. Name of column with effect sizes. THe default is \code{"beta"}.} +\item{beta_col}{Required for MR. Name of column with effect sizes. The default is \code{"beta"}.} \item{se_col}{Required for MR. Name of column with standard errors. The default is \code{"se"}.} diff --git a/man/sort_1_to_many.Rd b/man/sort_1_to_many.Rd index 8cd7ff32..4c18d4db 100644 --- a/man/sort_1_to_many.Rd +++ b/man/sort_1_to_many.Rd @@ -23,7 +23,7 @@ sort_1_to_many( \item{sort_action}{Choose how to sort results. \itemize{ \item \code{sort_action = 1}: sort results by effect size within groups. Use the group order supplied by the user. -\item \code{sort_action = 2}: sort results by effect size and group. Overides the group ordering supplied by the user. +\item \code{sort_action = 2}: sort results by effect size and group. Overrides the group ordering supplied by the user. \item \code{sort_action = 3}: group results for the same trait together (e.g. multiple results for the same trait from different MR methods). \item \code{sort_action = 4}: sort by decreasing effect size (largest effect size at top and smallest at bottom). \item \code{sort_action = 5}: sort by increasing effect size (smallest effect size at top and largest at bottom). diff --git a/man/steiger_sensitivity.Rd b/man/steiger_sensitivity.Rd index e73c22fc..89b42636 100644 --- a/man/steiger_sensitivity.Rd +++ b/man/steiger_sensitivity.Rd @@ -18,7 +18,7 @@ List with the following elements: \describe{ \item{vz}{Total volume of the error parameter space} \item{vz0}{Volume of the parameter space that gives the incorrect answer} -\item{vz1}{Volume of the paramtere space that gives the correct answer} +\item{vz1}{Volume of the parameter space that gives the correct answer} \item{sensitivity_ratio}{Ratio of vz1/vz0. Higher means inferred direction is less susceptible to measurement error} \item{pl}{plot of parameter space} } diff --git a/vignettes/harmonise.Rmd b/vignettes/harmonise.Rmd index e04e0637..b596a3db 100644 --- a/vignettes/harmonise.Rmd +++ b/vignettes/harmonise.Rmd @@ -68,7 +68,7 @@ Recent GWASs typically present the effects of a SNP in reference to the allele o Some examples are shown below: -### Correct, unambigious +### Correct, unambiguous ``` exposure effect = 0.5 @@ -82,7 +82,7 @@ other allele = G Here the effect allele on the exposure and the outcome is the same -### Incorrect reference, unambigious +### Incorrect reference, unambiguous ``` exposure effect = 0.5 @@ -165,7 +165,7 @@ ao[ao$trait == "Body mass index", c("trait", "id", "pmid", "author", "sample_siz ao[ao$trait == "Coronary heart disease", c("trait", "id", "pmid", "author", "ncase", "ncontrol", "nsnp")] ``` -There are therefore multiple potential combinations of body mass index and coronary heart disease, which would likely lead to duplicate MR analyses. We recommend that users prune their datasets so that only the exposure-outcome combination with the highested expected power is retained. This can be done by selecting the exposure-outcome summary set with the largest sample size for the outcome, using the power_prune function: +There are therefore multiple potential combinations of body mass index and coronary heart disease, which would likely lead to duplicate MR analyses. We recommend that users prune their datasets so that only the exposure-outcome combination with the highest expected power is retained. This can be done by selecting the exposure-outcome summary set with the largest sample size for the outcome, using the power_prune function: ```{r eval=FALSE} dat <- power_prune(dat, method = 1, dist.outcome = "binary") diff --git a/vignettes/perform_mr.Rmd b/vignettes/perform_mr.Rmd index 080f136b..4a71071d 100644 --- a/vignettes/perform_mr.Rmd +++ b/vignettes/perform_mr.Rmd @@ -232,7 +232,7 @@ p4[[1]] ## 1-to-many forest plot -A 1-to-many MR analysis interrogates the effect of a single exposure on multiple outcomes or multiple exposures on a single outcome. The results of this analysis can be visualised using the 1-to-many forest plot, with or without stratification on a categorical variable. From a visual point of view, the function works best for 50 or fewer results and is not really designed to handle more than a 100 results. If your number of results is much greater than 50, it may be better to split these across two separate plots. For example, if you have 100 sets of results you could divide these equally across two plots and then combine the two plots together in another programme like Powerpoint. The function assumes the results are already in the right order for plotting. As such, users are advised to sort their results according to how they would like them to appear in the plot. Users can use their own code to do this or they can use the `sort_1_to_many()` function. +A 1-to-many MR analysis interrogates the effect of a single exposure on multiple outcomes or multiple exposures on a single outcome. The results of this analysis can be visualised using the 1-to-many forest plot, with or without stratification on a categorical variable. From a visual point of view, the function works best for 50 or fewer results and is not really designed to handle more than a 100 results. If your number of results is much greater than 50, it may be better to split these across two separate plots. For example, if you have 100 sets of results you could divide these equally across two plots and then combine the two plots together in another program like Powerpoint. The function assumes the results are already in the right order for plotting. As such, users are advised to sort their results according to how they would like them to appear in the plot. Users can use their own code to do this or they can use the `sort_1_to_many()` function. ### Step 1: generate 1-to-many MR results @@ -755,7 +755,7 @@ The default is to subset on the IVW method when >1 SNP is available and to use t ### Combine all results -It is often useful to combine all results and study level characterists into a single dataframe or table, e.g. for sharing results with collaborators or when the user wishes to present all results in a single table or figure. This can be done using the `combine_all_mrresults()` function: +It is often useful to combine all results and study level characteristics into a single dataframe or table, e.g. for sharing results with collaborators or when the user wishes to present all results in a single table or figure. This can be done using the `combine_all_mrresults()` function: ```{r, eval=FALSE } res <- mr(dat)