Skip to contents

Mirrors 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.

Usage

morie_verify_statistical_output(path)

Arguments

path

Path to a JSON output file.

Value

A list with path, passed (logical), and checks (named list of boolean check results).

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)
}