cML_estimate function

Estimate with Regular Likelihood

Estimate with Regular Likelihood

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

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.

Returns

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)
  • Maintainer: Stephen Burgess
  • License: GPL-2 | GPL-3
  • Last published: 2024-04-12

Useful links