MR_2SLS: MR_2SLS

View source: R/MR_2SLS.R

MR_2SLSR Documentation

MR_2SLS

Description

Perform Two-Stage Least Squares (2SLS) Mendelian Randomization analysis.

Usage

MR_2SLS(
  infile,
  outcome,
  outcome_name,
  prs_cols_match,
  regexpr_pattern,
  standardise = TRUE,
  digits = 3,
  .progress = TRUE
)

Arguments

infile

The input file containing the data.

outcome

The outcome variable.

outcome_name

The name of the outcome variable.

prs_cols_match

The columns to match for PRS.

regexpr_pattern

The regular expression pattern to use for matching.

standardise

Whether to standardise the prs data, Default: TRUE

digits

The number of decimal places to round to, Default: 3

.progress

Whether to show progress, Default: TRUE

Details

This function performs a Two-Stage Least Squares (2SLS) Mendelian Randomization analysis.

Value

A list containing the results of the 2SLS analysis.

Author(s)

Zhen Lu luzh29@mail2.sysu.edu.cn

Siyang Liu liusy99@mail.sysu.edu.cn

See Also

fread, as.data.table, setattr, setDT select, reexports map str_extract nearPD cov.shrink


omixVizR documentation built on Nov. 5, 2025, 7:23 p.m.