TSLS_IV: Two stage least square method.

Description Usage Arguments Value Examples

View source: R/CIVMR_function.R

Description

This function implement ordinary two stage least square regression and provide variance estimation (if requested).

Usage

1
TSLS_IV(MR.data, Fstats = FALSE, var_cal = FALSE)

Arguments

MR.data:

data frame containing G,X,Z,Y.

Fstats:

return F-statistics or not. If multiple phenotypes (X) are used, Pillai statistics will be used instead.

var_cal:

return variance estimation or not.

Value

coef: the causal effect estimation β.

var: the variance estimation of β. if var_cal=TRUE.

stats: F-statistics (or Pillai statistics). if Fstats=TRUE.

pvalue: the pvalue of F-statistics. if Fstats=TRUE.

Examples

1
2

LaiJiang/CIVMR documentation built on July 16, 2020, 12:45 a.m.