TScMLStage1: Fit First Stage Model for 2ScML

View source: R/TScMLStage1.R

TScMLStage1R Documentation

Fit First Stage Model for 2ScML

Description

This function is used for fitting first stage model of 2ScML.

Usage

TScMLStage1(cor.D1Z1, Cap.Sigma.stage1, n1, p, ind.stage1, posdef = 1e-07)

Arguments

cor.D1Z1

A vector of length p, containing sample correlations (calculated with the first sample) between exposure D and p instruments.

Cap.Sigma.stage1

Sample correlation matrix between p instruments, could be calculated either with the first sample individual-level instruments data, or with the reference panel.

n1

First stage sample size.

p

Number of instruments.

ind.stage1

Indices of instruments relevant to exposure D.

posdef

A small positive constant to be added on diagonal of covariance matrix to ensure it is positive definite.

Value

A vector of length p, containing estimated effects from IVs to exposure D.


xue-hr/TScML documentation built on Feb. 4, 2025, 12:59 a.m.