Code is adapted by the SAMBA R package from Lauren Beesley and Bhramar Mukherjee.
perfect_sensitivity_EM(
Ystar,
Z,
X,
start,
beta0_fixed = NULL,
weights = NULL,
expected = TRUE,
tolerance = 1e-07,
max_em_iterations = 1500
)
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.
A numeric vector of indicator variables (1, 0) for the observed
outcome Y*
. The reference category is 0.
A numeric matrix of covariates in the true outcome mechanism.
Z
should not contain an intercept.
A numeric matrix of covariates in the observation mechanism.
X
should not contain an intercept.
Numeric vector of starting values for parameters in the true outcome mechanism (\(\theta\)) and the observation mechanism (\(\beta\)), respectively.
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
.
Optional vector of row-specific weights used for selection bias
adjustment. The default is NULL
.
A logical value indicating whether or not to calculate the
covariance matrix via the expected Fisher information matrix. The default is TRUE
.
A numeric value specifying when to stop estimation, based on
the difference of subsequent log-likelihood estimates. The default is 1e-7
.
An integer specifying the maximum number of
iterations of the EM algorithm. The default is 1500
.
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.