temp.df <- copy(df)
temp.df[,y:=y.obs]
mod.caroll.lik <- measerr_mle_dv(temp.df, outcome_formula=outcome_formula, proxy_formula=proxy_formula)
- fisher.info <- solve(mod.caroll.lik$hessian)
+ fischer.info <- solve(mod.caroll.lik$hessian)
coef <- mod.caroll.lik$par
- ci.upper <- coef + sqrt(diag(fisher.info)) * 1.96
- ci.lower <- coef - sqrt(diag(fisher.info)) * 1.96
+ ci.upper <- coef + sqrt(diag(fischer.info)) * 1.96
+ ci.lower <- coef - sqrt(diag(fischer.info)) * 1.96
result <- append(result,
list(Bxy.est.mle = coef['x'],
Bxy.ci.upper.mle = ci.upper['x'],
temp.df <- copy(df)
temp.df <- temp.df[,x:=x.obs]
mod.caroll.lik <- measerr_mle(temp.df, outcome_formula=outcome_formula, proxy_formula=proxy_formula, truth_formula=truth_formula)
- fisher.info <- solve(mod.caroll.lik$hessian)
- coef <- mod.caroll.lik$par
- ci.upper <- coef + sqrt(diag(fisher.info)) * 1.96
- ci.lower <- coef - sqrt(diag(fisher.info)) * 1.96
-
+
+ ## tryCatch({
+ ## mod.calibrated.mle <- mecor(y ~ MeasError(w_pred, reference = x.obs) + z, df, B=400, method='efficient')
+ ## (mod.calibrated.mle)
+ ## (mecor.ci <- summary(mod.calibrated.mle)$c$ci['x.obs',])
+ ## result <- append(result, list(
+ ## Bxy.est.mecor = mecor.ci['Estimate'],
+ ## Bxy.ci.upper.mecor = mecor.ci['UCI'],
+ ## Bxy.ci.lower.mecor = mecor.ci['LCI'])
+ ## )
+
+
+
+ fischer.info <- NA
+ ci.upper <- NA
+ ci.lower <- NA
+
+ tryCatch({fischer.info <- solve(mod.caroll.lik$hessian)
+ ci.upper <- coef + sqrt(diag(fischer.info)) * 1.96
+ ci.lower <- coef - sqrt(diag(fischer.info)) * 1.96
+ },
+
+ error=function(e) {result[['error']] <- as.character(e)
+ })
+
+ coef <- mod.caroll.lik$par
result <- append(result,
list(Bxy.est.mle = coef['x'],