CORTEST() performs a correlation test for one-to-one or many-to-one
variable relationships.
Arguments
- .model
A model ID from
rel(). When supplied, the test executes immediately. WhenNULL(default), returns atest_specfor use in the pipeline viaprepare_test().- .data
A data frame. Only used on the standalone path.
- ...
Additional arguments passed to the implementation:
.cor_type,.alt,.cifor the classical path.
Supported model IDs
rel()— many-to-one correlation test
Examples
# eager
CORTEST(rel(speed, dist), cars)
#> -- Summary ---------------------------------------------------------------------
#>
#> ─────────────────────────────────────────
#> pair estimate stat pval
#> ─────────────────────────────────────────
#> dist ~ speed 0.807 9.464 <0.001
#> ─────────────────────────────────────────
#>
#>
#> -- Confidence Interval ---------------------------------------------------------
#>
#> ────────────────────────────────────
#> pair lower_95 upper_95
#> ────────────────────────────────────
#> dist ~ speed 0.682 0.886
#> ────────────────────────────────────
#>
#>
# pipeline
cars |>
define_model(rel(speed, dist)) |>
prepare_test(CORTEST) |>
conclude()
#>
#> == Model =======================================================================
#>
#> Model ID : rel
#> Args : speed ; dist
#> x_vars : 1
#> resp_vars : 1
#>
#> == Correlation Test ============================================================
#>
#> -- Summary ---------------------------------------------------------------------
#>
#> ─────────────────────────────────────────
#> pair estimate stat pval
#> ─────────────────────────────────────────
#> dist ~ speed 0.807 9.464 <0.001
#> ─────────────────────────────────────────
#>
#>
#> -- Confidence Interval ---------------------------------------------------------
#>
#> ────────────────────────────────────
#> pair lower_95 upper_95
#> ────────────────────────────────────
#> dist ~ speed 0.682 0.886
#> ────────────────────────────────────
#>
#>