Skip to contents

Code is adapted by the SAMBA R package from Lauren Beesley and Bhramar Mukherjee.

Usage

perfect_sensitivity_EM(
  Ystar,
  Z,
  X,
  start,
  beta0_fixed = NULL,
  weights = NULL,
  expected = TRUE,
  tolerance = 1e-07,
  max_em_iterations = 1500
)

Arguments

Ystar

A numeric vector of indicator variables (1, 0) for the observed outcome Y*. The reference category is 0.

Z

A numeric matrix of covariates in the true outcome mechanism. Z should not contain an intercept.

X

A numeric matrix of covariates in the observation mechanism. X should not contain an intercept.

start

Numeric vector of starting values for parameters in the true outcome mechanism (\(\theta\)) and the observation mechanism (\(\beta\)), respectively.

beta0_fixed

Optional numeric vector of values of the observation mechanism intercept to profile over. If a single value is entered, this corresponds to fixing the intercept at the specified value. The default is NULL.

weights

Optional vector of row-specific weights used for selection bias adjustment. The default is NULL.

expected

A logical value indicating whether or not to calculate the covariance matrix via the expected Fisher information matrix. The default is TRUE.

tolerance

A numeric value specifying when to stop estimation, based on the difference of subsequent log-likelihood estimates. The default is 1e-7.

max_em_iterations

An integer specifying the maximum number of iterations of the EM algorithm. The default is 1500.

Value

perfect_sensitivity_EM returns a list containing nine elements. The elements are detailed in ?SAMBA::obsloglikEM documentation. Code is adapted from the SAMBA::obsloglikEM function.

References

Beesley, L. and Mukherjee, B. (2020). Statistical inference for association studies using electronic health records: Handling both selection bias and outcome misclassification. Biometrics, 78, 214-226.