Closed StanWijn closed 1 year ago
would it be possible to replace the "error" message by a warning clarifying the problem? Do we need to worry about the output? @phoebejiang
@StanWijn Lets update the examples so that the treatment coding is already in the preferred format
Yes, it's confusing to have a message showing "Error(s) occurred..." and not have the function stopped. We are forcing the function to continue when there are errors inside the CV iterations (e.g., too few events in Cox, etc) and want to tell the user that errors happen. Instead, we can output this as "Warning: Error(s) occurred...". Same thing for "Warning(s) occurred...", it can be written as "Warning: Warning(s) occurred..."
TODO: lets change the function so that a warning is cast at the end of the procedure.
no_errors<- 0
# Cross validation
for () {
fit <- tryCatch(estimate(...))
if ("warning" %in% class(fit)) {
no_errors <- no_errors + 1
}
} # end cross validation
if (no_errors > 0) {
warning("XXX folds were not able to run")
}
Two main errors/warnings still occur. Check with BioGen if we should resolve these.
1 ) Error in cv_surv() when estimating ATE in nested subgroups using "poisson", "randomForest".
The consecutive functions do not seem affected by these errors (plot, abc, outcomes). Is this really an error or can we reduce or resolve this error in any way?
Example:
2) Warnings regarding the conversion of drug0 and drug1 to 0/1
data.preproc will convert the variable trt to 0/1 from drug0 and drug1. This is probably done with interpretation in mind (on line 314 of utility_count.R this check / conversion is performed). Do we want to show this warning in the examples?
Example: