Verify that a serialised statistical output meets minimum quality gates
Source:R/inspector.R
morie_verify_statistical_output.RdMirrors the Python morie.verify_statistical_output(). Runs a small
suite of sanity checks on a JSON output containing fields commonly used
across MORIE estimators: ate, se, ci_lower, ci_upper, n,
p_value. Each check is a named boolean; the verification passes if all
checks are TRUE.
Details
Checks: SE non-negative; CI lower < CI upper; estimate inside the CI; n positive; p-value (if present) in [0, 1]; estimate finite.
Examples
tmp <- tempfile(fileext = ".json")
if (requireNamespace("jsonlite", quietly = TRUE)) {
jsonlite::write_json(
list(ate = 0.5, se = 0.1, ci_lower = 0.3, ci_upper = 0.7, n = 200),
tmp,
auto_unbox = TRUE
)
morie_verify_statistical_output(tmp)
unlink(tmp)
}