ard_stats_poisson_test: ARD Poisson Test

View source: R/ard_stats_poisson_test.R

ard_stats_poisson_testR Documentation

ARD Poisson Test

Description

Analysis results data for exact tests of a simple null hypothesis about the rate parameter in Poisson distribution, or the comparison of two rate parameters.

Usage

ard_stats_poisson_test(
  data,
  variables,
  na.rm = TRUE,
  by = NULL,
  conf.level = 0.95,
  ...
)

Arguments

data

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

variables

(tidy-select)
names of the event and time variables (in that order) to be used in computations. Must be of length 2.

na.rm

(scalar logical)
whether missing values should be removed before computations. Default is TRUE.

by

(tidy-select)
optional column name to compare by.

conf.level

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

...

arguments passed to poisson.test().

Details

  • For the ard_stats_poisson_test() function, the data is expected to be one row per subject.

  • If by is not specified, an exact Poisson test of the rate parameter will be performed. Otherwise, a Poisson comparison of two rate parameters will be performed on the levels of by. If by has more than 2 levels, an error will occur.

Value

an ARD data frame of class 'card'

Examples


# Exact test of rate parameter against null hypothesis
cards::ADTTE |>
  ard_stats_poisson_test(variables = c(CNSR, AVAL))

# Comparison test of ratio of 2 rate parameters against null hypothesis
cards::ADTTE |>
  dplyr::filter(TRTA %in% c("Placebo", "Xanomeline High Dose")) |>
  ard_stats_poisson_test(by = TRTA, variables = c(CNSR, AVAL))


cardx documentation built on Sept. 11, 2024, 9:12 p.m.