TScMLVar: Corrected Variance for Estimated Causal Effect

View source: R/TScMLVar.R

TScMLVarR Documentation

Corrected Variance for Estimated Causal Effect

Description

This function is for estimating corrected variance of estimated causal effect (i.e. beta) obtained from second stage. As described in our draft, the correction accounts for the effect of using reference panel.

Usage

TScMLVar(
  Z.ref.original,
  Stage1FittedModel,
  betaalpha.hat.stage2,
  Est.Sigma1Square,
  Est.Sigma2Square,
  n1,
  n2,
  n.ref
)

Arguments

Z.ref.original

The original reference panel, which is a n.ref (sample size of reference panel) by p (number of instruments) matrix.

Stage1FittedModel

A vector of length p, containing estimated effects from IVs to exposure obtained in the first stage model.

betaalpha.hat.stage2

A vector of length (p+1), the first element is the estimated beta (causal effect from exposure to outcome), the rest p elements are estimated alpha's (direct effects from IVs to outcome).

Est.Sigma1Square

A number, estimated variance of random error in the first stage.

Est.Sigma2Square

A number, estimated variance of random error in the second stage.

n1

Sample size in first stage.

n2

Sample size in second stage.

n.ref

Sample size of reference panel.

Value

A number, which is the estimated corrected variance of estimated causal effect.


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