Skip to contents

Appends a test outcome and a provenance entry. R does not change the theory in place, so assign the result.

Usage

tf_add_test_outcome(
  theory,
  prediction_id,
  passed,
  observed = NULL,
  estimate = NULL,
  se = NULL,
  registered = NULL,
  date = NULL
)

Arguments

theory

A theory object (named list).

prediction_id

The id of the prediction tested.

passed

TRUE or FALSE.

observed

Optional description of the result.

estimate, se

Optional estimate and standard error, given together, which tf_post_data_severity() reads with the prediction's bounds.

registered

Optional reference to the preregistration of the test.

date

Optional date of the test.

Value

The theory with the outcome added.

Examples

tf_theory("demo-1", "A demonstration theory") |>
  tf_add_test_outcome("h1", TRUE, observed = "switch cost 41 ms (SE 6)",
                      estimate = 41, se = 6)
#> $schema_version
#> [1] "1.1"
#> 
#> $id
#> [1] "demo-1"
#> 
#> $title
#> [1] "A demonstration theory"
#> 
#> $maturity
#> [1] "building"
#> 
#> $theory_form
#> [1] "network"
#> 
#> $provenance
#> $provenance[[1]]
#> $provenance[[1]]$step
#> [1] "1"
#> 
#> $provenance[[1]]$action
#> [1] "tf_theory"
#> 
#> $provenance[[1]]$detail
#> [1] "demo-1"
#> 
#> 
#> $provenance[[2]]
#> $provenance[[2]]$step
#> [1] "2"
#> 
#> $provenance[[2]]$action
#> [1] "tf_add_test_outcome"
#> 
#> $provenance[[2]]$detail
#> [1] "h1"
#> 
#> 
#> 
#> $test_outcomes
#> $test_outcomes[[1]]
#> $test_outcomes[[1]]$prediction_id
#> [1] "h1"
#> 
#> $test_outcomes[[1]]$passed
#> [1] TRUE
#> 
#> $test_outcomes[[1]]$observed
#> [1] "switch cost 41 ms (SE 6)"
#> 
#> $test_outcomes[[1]]$estimate
#> [1] 41
#> 
#> $test_outcomes[[1]]$se
#> [1] 6
#> 
#> 
#>