Skip to contents

Read the shared public result accessors and preserve stored numerical quantities and metadata.

Usage

report_table(x, rows = NULL, p = c("reported", "raw", "adjusted"),
  digits = 3L, p_digits = 3L, decimal_mark = ".")
report_text(x, rows = NULL, p = c("reported", "raw", "adjusted"),
  digits = 3L, p_digits = 3L, decimal_mark = ".",
  style = c("full", "p", "estimate_ci", "estimate_ci_p", "stars"),
  template = NULL)
report_metadata(x)

Arguments

x

A finalized result supporting infercalcR::result_data() and result_metadata(); for report_metadata, a reporting output or native import.

rows

Unique stored row IDs to display, or NULL for all.

p

Select stored reported, raw or adjusted p-values. An adjusted request fails if a selected value is absent.

digits, p_digits

Display precision for estimates and p-values.

decimal_mark

Either a dot or comma.

style

Full neutral text or a compact label preset.

template

Optional string containing approved fields in braces: estimate, ci, p, statistic, method, estimand, contrast, status, n. This is substitution only, without evaluation.

Value

report_table returns an ordinary data.frame. Original analytical columns retain full precision, with additional columns ending in _display, and p_selected/p_selection. Metadata is an attribute accessed by report_metadata. report_text returns a named character vector with the same metadata.

Details

Filtering changes presentation only; metadata retains the entire adjustment family. No test, model, interval or adjustment is recomputed. Full text preserves estimand, orientation, interval method/scale/scope, confidence level, sample size and unavailable status when supplied. It does not assign clinical meaning or infer equivalence from nonsignificance. Numerical optimization bounds are not interpreted as confidence intervals. Stars use thresholds .05, .01, .001 and .0001; missing or unresolved results never acquire stars or ns. A stored decision conflicting with these display thresholds is shown explicitly. Compact labels for non-ok rows show unavailable status.

Examples

x <- infercalcR::new_inference_result(
  data.frame(row_id = "contrast", estimate = 1.2, conf.low = 0.2,
    conf.high = 2.2, conf.level = 0.95, p.value = 0.021,
    estimand = "mean difference", status = "ok"),
  list(method_id = "example", result_id = "study-1"))
report_table(x)
#>     row_id estimate conf.low conf.high conf.level p.value        estimand
#> 1 contrast      1.2      0.2       2.2       0.95   0.021 mean difference
#>   status variable_id component contrast statistic df interval.method
#> 1     ok        <NA>      <NA>     <NA>        NA NA            <NA>
#>   interval.scale interval.scope p.adjusted p.reported p.method family_id
#> 1           <NA>           <NA>         NA      0.021     <NA>      <NA>
#>   family_size null.value alternative  n n.excluded reason p_selected
#> 1          NA         NA        <NA> NA         NA   <NA>      0.021
#>   p_selection result_id method_id variant_id estimate_display interval_display
#> 1    reported   study-1   example    example              1.2       [0.2, 2.2]
#>   statistic_display p_display confidence_display
#> 1       unavailable p = 0.021                95%
report_text(x)
#>                                                                                 contrast 
#> "example; mean difference: estimate 1.2; 95% interval [0.2, 2.2]; p = 0.021 (reported)." 
#> attr(,"inference_metadata")
#> attr(,"inference_metadata")$method_id
#> [1] "example"
#> 
#> attr(,"inference_metadata")$result_id
#> [1] "study-1"
#> 
#> attr(,"inference_metadata")$variant_id
#> [1] "example"
#> 
#> attr(,"inference_metadata")$contract_version
#> [1] "1.0.0"
#> 
#> attr(,"inference_metadata")$kind
#> [1] "inference"
#> 
#> attr(,"inference_metadata")$provenance
#> attr(,"inference_metadata")$provenance$package
#> [1] "infercalcR"
#> 
#> attr(,"inference_metadata")$provenance$version
#> [1] "0.1.0"
#> 
#> attr(,"inference_metadata")$provenance$R
#> [1] "4.6.2"
#> 
#> 
#> attr(,"inference_metadata")$validation
#> [1] "not_assessed"
#>