ml_linear_logistic_linear: Maximum Likelihood with Three Models: Linear Regression,...

Description Usage Arguments Details Value

Description

Calculates maximum likelihood estimates for measurement error/unmeasured confounding scenario where Y|(Z,X,C,B) is linear regression, X|(Z,C,B) is logistic regression, and Z|(D,C) is linear regression.

Usage

1
2
3
4
5
ml_linear_logistic_linear(all_data = NULL, main = NULL,
  internal = NULL, external = NULL, y_var, x_var, z_var,
  d_vars = NULL, c_vars = NULL, b_vars = NULL,
  integrate_tol = 1e-08, integrate_tol_hessian = integrate_tol,
  estimate_var = FALSE, fix_posdef = FALSE, ...)

Arguments

all_data

Data frame with data for main study and validation study.

main

Data frame with data for the main study.

internal

Data frame with data for internal validation study.

external

Data frame with data for the external validation study.

y_var

Character string specifying name of Y variable.

x_var

Character string specifying name of X variable.

z_var

Character string specifying name of Z variable.

d_vars

Character string specifying name of D variables.

c_vars

Character vector specifying names of C variables.

b_vars

Character vector specifying names of variables in true disease model but not in measurement error model.

integrate_tol

Numeric value specifying tol input to hcubature for numerical integration.

integrate_tol_hessian

Same as integrate_tol, but for use when estimating the Hessian matrix only. Sometimes using a smaller value than for likelihood maximization helps prevent cases where the inverse Hessian is not positive definite.

estimate_var

Logical value for whether to return variance-covariance matrix for parameter estimates.

fix_posdef

Logical value for whether to repeatedly reduce integrate_tol_hessian by factor of 5 and re-estimate Hessian to try to avoid non-positive definite variance-covariance matrix.

...

Additional arguments to pass to nlminb.

Details

The true disease model is:

Y = beta_0 + beta_x X + beta_z Z + beta_c^T C + beta_b^T B + e, e ~ N(0, sigsq_e)

The X|(Z,C,B) model is:

logit[P(X = 1)] = gamma_0 + gamma_z Z + gamma_c^T C + gamma_b^T B

The Z|(D,C) model is:

Z = alpha_0 + alpha_d^T D + alpha_c^T C + d, d ~ N(0, sigsq_d)

There should be main study data with (Y, X, D, C, B) as well as internal validation data with (Y, X, Z, D, C, B) and/or external validation data with (Z, X, D, C). Parameters are theoretically identifiable without validation data, but estimation may be impractical in that scenario.

Value

List containing:

  1. Numeric vector of parameter estimates.

  2. Variance-covariance matrix (if estimate_var = TRUE).

  3. Returned nlminb object from maximizing the log-likelihood function.

  4. Akaike information criterion (AIC).


vandomed/meuc documentation built on May 12, 2019, 6:17 p.m.