### Execute mr_cML with Random Start and Parameters Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md This snippet demonstrates the execution of the `mr_cML` function with `random_start` set to 10 and other specified parameters. It also highlights potential convergence warnings from `cML_estimate_random`, indicating issues with Fisher Information matrices and suggesting adjustments to iterations or start points. ```R mr_cML(Input1, random_start = 10, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723) ``` -------------------------------- ### Install MendelianRandomization Package Source: https://github.com/amymariemason/mr/blob/main/Index.md Installs the released version of the MendelianRandomization R package from the Comprehensive R Archive Network (CRAN). This is the standard method for obtaining the latest stable release. ```r install.packages("MendelianRandomization") ``` -------------------------------- ### Install MendelianRandomization Package Source: https://github.com/amymariemason/mr/blob/main/README.md Installs the latest released version of the MendelianRandomization R package directly from the Comprehensive R Archive Network (CRAN). This is the standard method for obtaining the package for use in R. ```r install.packages("MendelianRandomization") ``` -------------------------------- ### Apply mr_mvgmm with robust option off in R Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvgmm.md Demonstrates applying `mr_mvgmm` with the `robust` option set to `FALSE`, disabling overdispersion heterogeneity and showing the resulting model output. ```R mr_mvgmm(Input1, nx = rep(17723, 3), ny = 17723, robust = FALSE) ``` -------------------------------- ### Apply mr_mvgmm with correlation matrix in R Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvgmm.md Shows how to apply `mr_mvgmm` with an explicit correlation matrix for exposures, presenting results for a robust model with overdispersion heterogeneity. ```R mr_mvgmm(Input1, nx = rep(17723, 3), ny = 17723, cor.x = rho_mat) ``` -------------------------------- ### Apply mr_mvgmm to standard objects in R Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvgmm.md Demonstrates applying the `mr_mvgmm` function to standard objects, showing results for uncorrelated exposures and a robust model with overdispersion heterogeneity. ```R mr_mvgmm(Input1, nx = rep(17723, 3), ny = 17723) ``` -------------------------------- ### Apply mvcML with Custom Random Start Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Illustrates setting a specific starting point for the random number generator (random_start) in the mr_mvcML function. This can be used for reproducibility or exploring different optimization paths. ```R mr_mvcML(Input1, random_start = 2, n = 17723) ``` -------------------------------- ### R: Apply mr_divw with Default Settings Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_divw.md Applies the debiased inverse-variance weighted (dIVW) method using the `mr_divw` function with default parameters. This example shows the output when `over.dispersion` is TRUE. ```R mr_divw(Input1) ``` -------------------------------- ### R: mr_cML Function Call and Convergence Warnings Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md This snippet demonstrates a call to the 'mr_cML' function in R with specific parameters. It also includes detailed warnings from 'cML_estimate_random' indicating potential convergence problems, suggesting that the model may not converge to minimums with given start points and maximum iterations, leading to non-positive definite Fisher Information matrices. Recommendations include increasing iterations or trying different start points. ```R mr_cML(Input1, random_start_pert = 10, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723) # Warnings: # Warning in `cML_estimate_random()`: May not converge to minimums with some given start points and maximum number of iteration, lead to Fisher Information matrices not positive definite. Could try increasing number of iterations (maxit) or try different start points. Note: If multiple random start points are used, this warning does not likely affect result. ``` -------------------------------- ### Apply mr_mvgmm with alpha changed in R Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvgmm.md Illustrates applying `mr_mvgmm` with a modified `alpha` parameter, affecting the confidence interval calculation, for a robust model with overdispersion heterogeneity. ```R mr_mvgmm(Input1, nx = rep(17723, 3), ny = 17723, alpha = 0.001) ``` -------------------------------- ### Apply mr_cML with random_start parameter Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Shows the `mr_cML` function usage with the `random_start` parameter set to 0. This parameter influences the starting point for optimization in the Constrained Maximum Likelihood method, alongside other common parameters. ```R mr_cML(Input1, random_start = 0, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723) ``` -------------------------------- ### Apply mr_mvgmm to correlated objects in R Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvgmm.md Applies `mr_mvgmm` to correlated objects, noting potential convergence issues with conditional F statistics and presenting results for a robust model with overdispersion heterogeneity. ```R mr_mvgmm(Input3, nx = rep(17723, 3), ny = 17723) ``` -------------------------------- ### Apply PC-GMM with `r` Parameter Changed Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pcgmm.md Illustrates how changing the `r` parameter in `mr_pcgmm` affects the number of principal components used and the model output. This example sets `r = 4` while keeping `nx` and `ny` constant. ```R mr_pcgmm(Input1, nx = 17723, ny = 17723, r = 4) ``` -------------------------------- ### Apply PC-GMM with `thres` Parameter Changed Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pcgmm.md Shows the effect of modifying the `thres` parameter in the `mr_pcgmm` function. This example sets `thres = 0.85` to observe changes in the number of principal components and the statistical output. ```R mr_pcgmm(Input1, nx = 17723, ny = 17723, thres = 0.85) ``` -------------------------------- ### Apply mr_cML with DP disabled Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Illustrates the `mr_cML` function with the `DP` parameter set to `FALSE`, disabling another aspect of the Constrained Maximum Likelihood method. The example includes `MA`, `n`, and `num_pert`. ```R mr_cML(Input1, MA = TRUE, DP = FALSE, n = 17723) ``` -------------------------------- ### Apply mr_pivw with custom alpha Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pivw.md Shows how to modify the alpha level for confidence interval reporting in the mr_pivw function. This example sets a custom alpha for a 99.9% confidence interval. ```R mr_pivw(Input1, alpha = 0.001) ``` -------------------------------- ### Demonstrate changing alpha in mr_mvcML Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Presents an example of adjusting the 'alpha' parameter to 0.001 in the mr_mvcML function. The output displays the Multivariable MRcML method's results, including updated confidence intervals (99.9% CI) and p-values, reflecting the change in the significance threshold. ```code mr_mvcML(Input1, n = 17723, alpha = 0.001) ``` -------------------------------- ### Apply mr_pivw with standard settings Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pivw.md Demonstrates the basic application of the mr_pivw function with default or standard parameters. It shows the output including estimated coefficients, standard errors, confidence intervals, and p-values. ```R mr_pivw(Input1) ``` -------------------------------- ### Apply PC-GMM with Default Parameters Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pcgmm.md Demonstrates the basic application of the `mr_pcgmm` function with default parameters. It shows the output including statistical estimates and heterogeneity parameters, using specified `nx` and `ny` values. ```R mr_pcgmm(Input1, nx = 17723, ny = 17723) ``` -------------------------------- ### Load MendelianRandomization Package Source: https://github.com/amymariemason/mr/blob/main/Index.md Loads the MendelianRandomization R package into the current R session. This makes all its functions and datasets available for use in your analysis. ```r library(MendelianRandomization) ``` -------------------------------- ### Load MendelianRandomization Package Source: https://github.com/amymariemason/mr/blob/main/README.md Loads the MendelianRandomization package into the current R session, making its functions available for use. This is a prerequisite for performing any Mendelian randomization analyses. ```r library(MendelianRandomization) ``` -------------------------------- ### Apply mr_pivw with Boot.Fieller off Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pivw.md Illustrates disabling the Bootstrapping Fieller method in the mr_pivw function. This parameter controls the method used for confidence interval calculation, particularly in the presence of heteroskedasticity. ```R mr_pivw(Input1, Boot.Fieller = FALSE) ``` -------------------------------- ### Prepare MR Input Data Source: https://github.com/amymariemason/mr/blob/main/README.md Creates an MRInput object required by the MendelianRandomization package. This function takes genetic association estimates (beta coefficients) and their standard errors for both the exposure (bx, bxse) and the outcome (by, byse) as input. ```r MRInputObject <- mr_input(bx = ldlc, bxse = ldlcse, by = chdlodds, byse = chdloddsse) ``` -------------------------------- ### Perform and Visualize MR Methods (R) Source: https://github.com/amymariemason/mr/blob/main/README.md This R code snippet demonstrates how to perform alternative Mendelian Randomization (MR) analysis methods, such as MR-Egger and weighted median, using the `mr_allmethods` function. It then displays the results and generates a plot of the findings using `mr_plot`. The primary input is an `MRInputObject`. ```r MRAllObject <- mr_allmethods(MRInputObject, method="main") # perform MR-Egger and median methods MRAllObject # view results #> Method Estimate Std Error 95% CI P-value #> Simple median 1.755 0.740 0.305 3.205 0.018 #> Weighted median 2.683 0.419 1.862 3.504 0.000 #> IVW 2.834 0.530 1.796 3.873 0.000 #> MR-Egger 3.253 0.770 1.743 4.762 0.000 #> (intercept) -0.011 0.015 -0.041 0.018 0.451 mr_plot(MRAllObject) # plot results ``` -------------------------------- ### R: Apply mr_mvpcgmm to Standard Object Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvpcgmm.md Demonstrates the application of the mr_mvpcgmm function to a standard object. It assumes exposures are uncorrelated and shows the resulting estimates, standard errors, and p-values for each exposure. ```R mr_mvpcgmm(Input1, nx = rep(17723, 3), ny = 17723) ``` -------------------------------- ### Apply mr_pivw with delta and sel.pval Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pivw.md Demonstrates applying the mr_pivw function with specific thresholds for IV selection, using the delta and sel.pval parameters. This allows for more targeted inclusion of instrumental variables. ```R mr_pivw(Input1, delta = delta, sel.pval = sel.pval) ``` -------------------------------- ### R: mr_mvpcgmm with Robust Off Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvpcgmm.md Demonstrates the mr_mvpcgmm function in R with robust set to FALSE. The output details exposure estimates, confidence intervals, p-values, and heterogeneity test statistics for a non-robust model, assuming uncorrelated exposures. ```R mr_mvpcgmm(Input2, nx = rep(17723, 3), ny = 17723, robust = FALSE) ``` -------------------------------- ### Apply mvcML with Default DP Settings Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Demonstrates the basic application of the mr_mvcML function with default Data Perturbation (DP) settings. It takes an input dataset and the number of variants, producing multivariable MRcML results. ```R mr_mvcML(Input1, n = 17723) ``` -------------------------------- ### Apply mr_cML with MA and DP enabled Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Demonstrates the `mr_cML` function with `MA` and `DP` parameters set to `TRUE`. This applies the Constrained Maximum Likelihood method with specific settings, including `num_pert` and `n`. ```R mr_cML(Input1, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723) ``` -------------------------------- ### Create MRInput Object Source: https://github.com/amymariemason/mr/blob/main/Index.md Creates an MRInput object, which is a data structure required by most functions in the MendelianRandomization package. It takes genetic association estimates (beta coefficients) and their standard errors for both the exposure (bx, bxse) and the outcome (by, byse). ```r MRInputObject <- mr_input(bx = ldlc, bxse = ldlcse, by = chdlodds, byse = chdloddsse) ``` -------------------------------- ### Apply mr_cML with K_vec parameter Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Demonstrates the `mr_cML` function when the `K_vec` parameter is specified with a range of values (0 to 5). This allows for custom input for the Constrained Maximum Likelihood method, alongside other standard parameters. ```R mr_cML(Input1, K_vec = 0:5, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723) ``` -------------------------------- ### R: Apply mr_mvpcgmm with Correlation Matrix Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvpcgmm.md Shows how to apply mr_mvpcgmm when an exposure correlation matrix ('cor.x') is provided. This accounts for correlations between exposures, potentially leading to different estimates and statistical significance. ```R mr_mvpcgmm(Input2, nx = rep(17723, 3), ny = 17723, cor.x = corr_ex) ``` -------------------------------- ### Demonstrate changing random_seed in mr_mvcML Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Illustrates calling the mr_mvcML function with a specific random seed (2000) to control reproducibility. The output shows the results of the Multivariable MRcML method, including exposure estimates, standard errors, confidence intervals, and p-values. ```code mr_mvcML(Input1, n = 17723, seed = 2000) ``` -------------------------------- ### Demonstrate changing n in mr_mvcML Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Shows how to modify the 'n' parameter in the mr_mvcML function, setting it to 2000. The provided output details the Multivariable MRcML results, highlighting the number of variants, convergence statistics, and the estimated effects of exposures. ```code mr_mvcML(Input1, n = 2000) ``` -------------------------------- ### Apply PC-GMM with `robust` Parameter Set to FALSE Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pcgmm.md Demonstrates disabling the robust model and overdispersion heterogeneity by setting `robust = FALSE` in the `mr_pcgmm` function. This changes the model's assumptions and output interpretation. ```R mr_pcgmm(Input1, nx = 17723, ny = 17723, robust = FALSE) ``` -------------------------------- ### R: mvpcgmm with Alpha Changed Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvpcgmm.md Illustrates the mr_mvpcgmm function in R with alpha set to 0.001. The output highlights a robust model with overdispersion heterogeneity, including an estimated overdispersion parameter and a heterogeneity test statistic. ```R mr_mvpcgmm(Input2, nx = rep(17723, 3), ny = 17723, alpha = 0.001) ``` -------------------------------- ### R: Apply mr_mvpcgmm to Correlated Object Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvpcgmm.md Illustrates the use of mr_mvpcgmm with an object containing correlated exposures. The output includes regression coefficients, standard errors, and confidence intervals, assuming no external correlation matrix is provided. ```R mr_mvpcgmm(Input2, nx = rep(17723, 3), ny = 17723) ``` -------------------------------- ### Perform Multiple MR Methods Source: https://github.com/amymariemason/mr/blob/main/Index.md Performs a suite of Mendelian randomization methods, including simple median, weighted median, IVW, and MR-Egger (with intercept test). This allows for robustness checks of the causal estimates. ```r MRAllObject <- mr_allmethods(MRInputObject, method="main") MRAllObject ``` -------------------------------- ### Apply mr_pivw with custom lambda Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pivw.md Illustrates how to adjust the penalty parameter (lambda) in the mr_pivw function. Changing lambda can affect the regularization applied to the inverse-variance weighted estimation. ```R mr_pivw(Input1, lambda = 2) ``` -------------------------------- ### Apply mr_pivw with over.dispersion off Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pivw.md Shows the effect of disabling the over-dispersion correction in the mr_pivw function. This can be useful when the data exhibits low heterogeneity. ```R mr_pivw(Input1, over.dispersion = FALSE) ``` -------------------------------- ### Apply mvcML with Increased Max Iterations Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Shows how to increase the maximum number of iterations (maxit) for the mr_mvcML function. This can be useful if the algorithm is not converging within the default number of steps. ```R mr_mvcML(Input1, n = 17723, maxit = 2000) ``` -------------------------------- ### R: Apply mr_mvpcgmm with Changed 'r' Parameter Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvpcgmm.md Demonstrates the effect of changing the 'r' parameter in the mr_mvpcgmm function. This parameter influences the number of principal components used in the analysis, impacting the model's complexity and results. ```R mr_mvpcgmm(Input2, nx = rep(17723, 3), ny = 17723, r = 4) ``` -------------------------------- ### Changing random_seed parameter in mr_cML Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Illustrates setting the 'random_seed' parameter for the mr_cML function. This ensures reproducibility of results, especially when the method involves random initialization or sampling. ```R mr_cML(Input1, K_vec = 0:9, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723, random_seed = 2000) ``` -------------------------------- ### Changing maxit parameter in mr_cML Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Demonstrates adjusting the 'maxit' parameter in the mr_cML function. Increasing 'maxit' can help prevent convergence issues and ensure Fisher Information matrices are positive definite, potentially leading to more stable results. ```R mr_cML(Input1, K_vec = 9, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723, maxit = 2000) ``` -------------------------------- ### Apply mvcML with Custom K_vec Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Demonstrates setting a custom vector for the number of components (K_vec) in the mr_mvcML function. This parameter controls the dimensionality of the analysis. ```R mr_mvcML(Input1, K_vec = 0:5, n = 17723) ``` -------------------------------- ### Apply PC-GMM with `alpha` Parameter Changed Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_pcgmm.md Illustrates the impact of changing the `alpha` parameter in the `mr_pcgmm` function, specifically setting `alpha = 0.001`. This affects the confidence interval calculation for the estimates. ```R mr_pcgmm(Input1, nx = 17723, ny = 17723, alpha = 0.001) ``` -------------------------------- ### Apply mr_cML with MA disabled Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Shows how to use the `mr_cML` function when the `MA` parameter is set to `FALSE`, disabling a specific feature of the Constrained Maximum Likelihood method. Other parameters like `num_pert`, `DP`, and `n` are also specified. ```R mr_cML(Input1, num_pert = 5, MA = FALSE, DP = TRUE, n = 17723) ``` -------------------------------- ### R: Apply mr_mvpcgmm with Changed 'thres' Parameter Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvpcgmm.md Illustrates the impact of modifying the 'thres' parameter in mr_mvpcgmm. This threshold likely affects the selection or weighting of principal components, altering the final estimates and statistical outputs. ```R mr_mvpcgmm(Input2, nx = rep(17723, 3), ny = 17723, thres = 0.85) ``` -------------------------------- ### Plot MR Results Source: https://github.com/amymariemason/mr/blob/main/Index.md Generates a plot to visualize Mendelian randomization results. It can display the causal estimates from different methods, often including an IVW regression line. ```r mr_plot(MRInputObject, line="ivw", interactive = FALSE) # For plotting results from multiple methods: # mr_plot(MRAllObject) ``` -------------------------------- ### Apply mvcML with Custom Rho Matrix Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Shows how to incorporate a custom correlation matrix (rho_mat) into the mr_mvcML analysis. This allows for specifying the correlation structure between exposures. ```R mr_mvcML(Input1, n = 17723, rho_mat = rho_mat) ``` -------------------------------- ### Perform Inverse-Variance Weighted (IVW) Method Source: https://github.com/amymariemason/mr/blob/main/Index.md Performs a two-sample Mendelian Randomization analysis using the Inverse-Variance Weighted (IVW) method. This method assumes variants are uncorrelated and uses a random-effect model by default. It estimates the causal effect of the exposure on the outcome. ```r MRAllObject_ivw <- mr_ivw(MRInputObject) MRAllObject_ivw ``` -------------------------------- ### Plot Mendelian Randomization Results Source: https://github.com/amymariemason/mr/blob/main/README.md Generates a plot visualizing the Mendelian randomization results, specifically highlighting the Inverse-Variance Weighted (IVW) method. This plot helps in assessing the causal effect and the consistency of estimates across genetic variants. ```r mr_plot(MRInputObject, line="ivw", interactive = FALSE) # plot results ``` -------------------------------- ### Apply mvcML with Custom Theta Range Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Demonstrates setting custom minimum and maximum values for the theta range (min_theta_range, max_theta_range) in the mr_mvcML function. This constrains the search space for model parameters. ```R mr_mvcML(Input1, n = 17723, min_theta_range = -408, max_theta_range = 226, random_start = 2) ``` -------------------------------- ### R: Apply mr_divw without Overdispersion Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_divw.md Applies the debiased inverse-variance weighted (dIVW) method using the `mr_divw` function with `over.dispersion` set to FALSE. This adjusts the calculation by not accounting for overdispersion. ```R mr_divw(Input1, over.dispersion = FALSE) ``` -------------------------------- ### Apply mvcML with DP Disabled Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_mvcML.md Illustrates how to disable the Data Perturbation (DP) feature in the mr_mvcML function by setting the DP argument to FALSE. This typically changes the output to MVMRcML-BIC. ```R mr_mvcML(Input1, n = 17723, DP = FALSE) ``` -------------------------------- ### Perform Inverse-Variance Weighted (IVW) Method Source: https://github.com/amymariemason/mr/blob/main/README.md Applies the Inverse-Variance Weighted (IVW) method to the MRInputObject to estimate the causal effect. The IVW method is a common and robust approach for Mendelian randomization when variants are assumed to be uncorrelated. ```r MRAllObject_ivw <- mr_ivw(MRInputObject) # perform IVW method MRAllObject_ivw # view results ``` -------------------------------- ### Changing Alpha parameter in mr_cML Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Demonstrates setting the 'Alpha' parameter, likely a significance level or threshold, for the mr_cML function. Adjusting 'Alpha' impacts the confidence intervals and the interpretation of statistical significance. ```R mr_cML(Input1, K_vec = 0:9, num_pert = 5, MA = TRUE, DP = TRUE, n = 17723, Alpha = 0.001) ``` -------------------------------- ### Changing n parameter in mr_cML Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_cML.md Shows how to modify the 'n' parameter, likely representing sample size or a related characteristic, in the mr_cML function. Changes in 'n' can affect the statistical power and precision of the estimates. ```R mr_cML(Input1, K_vec = 0:9, num_pert = 5, MA = TRUE, DP = TRUE, n = 2000) ``` -------------------------------- ### R: Apply mr_divw with Changed Alpha Source: https://github.com/amymariemason/mr/blob/main/tests/testthat/_snaps/mr_divw.md Applies the debiased inverse-variance weighted (dIVW) method using the `mr_divw` function with a custom `alpha` value of 0.001. This changes the confidence interval calculation to 99.9% CI. ```R mr_divw(Input1, alpha = 0.001) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.