cML_estimate: Estimate with Regular Likelihood

View source: R/mr_cML-methods.R

cML_estimateR Documentation

Estimate with Regular Likelihood

Description

Internal function of mr_cML. Estimate theta, b vector, r vector with constrained maximum likelihood.

Usage

cML_estimate(
  b_exp,
  b_out,
  se_exp,
  se_out,
  K,
  initial_theta = 0,
  initial_mu = rep(0, length(b_exp)),
  maxit = 100
)

Arguments

b_exp

Vector of estimated effects for exposure.

b_out

Vector or estimated effects for outcome.

se_exp

Vector of standard errors for exposure.

se_out

Vector of standard errors for outcome.

K

Constraint parameter, number of invalid IVs.

initial_theta

Starting point for theta.

initial_mu

Starting point for mu.

maxit

Maximum number of iteration.

Value

A list contains: theta is the estimate causal effect, b_vec is the estimated vector of b, r_vec is the estimated vector of r.

Examples

cML_estimate(b_exp = ldlc,b_out = chdlodds,se_exp = ldlcse,
se_out = chdloddsse, K = 5)

MendelianRandomization documentation built on May 29, 2024, 11:36 a.m.