+
+ mle_result <- list(Bxy.est.mle = coef['x'],
+ Bxy.ci.upper.mle = ci.upper['x'],
+ Bxy.ci.lower.mle = ci.lower['x'],
+ Bzy.est.mle = coef['z'],
+ Bzy.ci.upper.mle = ci.upper['z'],
+ Bzy.ci.lower.mle = ci.lower['z'])
+ },
+ error=function(e) {result[['error']] <- as.character(e)
+ })
+
+ result <- append(result, mle_result)
+ mle_result_proflik <- list(Bxy.est.mle.profile = NULL,
+ Bxy.ci.upper.mle.profile = NULL,
+ Bxy.ci.lower.mle.profile = NULL,
+ Bzy.est.mle.profile = NULL,
+ Bzy.ci.upper.mle.profile = NULL,
+ Bzy.ci.lower.mle.profile = NULL)
+
+ tryCatch({
+ ## confint_method == 'bbmle'
+ mod.caroll.lik <- measerr_mle(temp.df, outcome_formula=outcome_formula, proxy_formula=proxy_formula, truth_formula=truth_formula, method='bbmle')
+ coef <- coef(mod.caroll.lik)
+ ci <- confint(mod.caroll.lik, method='spline')
+ ci.lower <- ci[,'2.5 %']
+ ci.upper <- ci[,'97.5 %']
+
+ mle_result_proflik <- list(Bxy.est.mle.profile = coef['x'],
+ Bxy.ci.upper.mle.profile = ci.upper['x'],
+ Bxy.ci.lower.mle.profile = ci.lower['x'],
+ Bzy.est.mle.profile = coef['z'],
+ Bzy.ci.upper.mle.profile = ci.upper['z'],
+ Bzy.ci.lower.mle.profile = ci.lower['z'])