Skip to contents

Analysis results data for McNemar's statistical test.

Usage

ard_mcnemartest(data, by, variable, ...)

Arguments

data

(data.frame)
a data frame. See below for details.

by

(tidy-select)
column name to compare by.

variable

(tidy-select)
column name to be compared.

...

arguments passed to stats::mcnemar.test(...)

Value

ARD data frame

Details

For the ard_mcnemartest() function, the data is expected to be one row per subject. The data is passed as stats::mcnemar.test(x = data[[variable]], y = data[[by]], ...). Please use table(x = data[[variable]], y = data[[by]]) to check the contingency table.

Examples

cards::ADSL |>
  ard_mcnemartest(by = "SEX", variable = "EFFFL")
#> {cards} data frame: 4 x 9
#>   group1 variable   context stat_name stat_label      stat
#> 1    SEX    EFFFL mcnemart… statistic  X-square…    111.91
#> 2    SEX    EFFFL mcnemart…   p.value    p-value         0
#> 3    SEX    EFFFL mcnemart… parameter  Degrees …         1
#> 4    SEX    EFFFL mcnemart…    method     method McNemar'…
#>  3 more variables: fmt_fn, warning, error