Description Usage Arguments Details Value Methods (by class) Examples
Test on rare events using an exact test on the Poisson distribution rate
parameter (stats::poisson.test()
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | poisson_rare(df, ...)
## S3 method for class 'mds_ts'
poisson_rare(df, ts_event = c(Count = "nA"), analysis_of = NA, ...)
## Default S3 method:
poisson_rare(
df,
analysis_of = NA,
eval_period = NULL,
zero_rate = 2/3,
p_rate = 0.2,
p_crit = 0.05,
...
)
|
df |
Required input data frame of class
|
... |
Further arguments passed onto |
ts_event |
Required if Default: Example: |
analysis_of |
Optional string indicating the English description of what
was analyzed. If specified, this will override the name of the
Default: Example: |
eval_period |
Optional positive integer indicating the number of unique times counting in reverse chronological order to assess. Default: |
zero_rate |
Required minimum proportion of Default: |
p_rate |
Hypothesized Poisson rate parameter null value at which the Poisson test is performed (null vs. greater). See details for more. Default: |
p_crit |
Critical p-value for the Poisson test.. Default: |
p_rate
default of 0.2
is a suggested null value for
the Poisson rate parameter. However this value is highly advised to be set
based on known priors and/or your specific application.
A named list of class mdsstat_test
object, as follows:
Name of the test run
English description of what was analyzed
Named boolean of whether the test was run. The name contains the run status.
A standardized list of test run results: statistic
for the test statistic, lcl
and ucl
for the 95
confidence bounds, p
for the p-value, signal
status, and
signal_threshold
.
The test parameters
The data on which the test was run
mds_ts
: Poisson on mds_ts data
default
: Poisson on general data
1 2 3 4 5 6 7 8 9 | # Basic Example
data <- data.frame(time=c(1:8), event=c(rep(0, 6), stats::rpois(2, 4)))
a1 <- poisson_rare(data)
# Example using an mds_ts object
a2 <- poisson_rare(mds_ts[[1]])
# Example using a derived rate as the "event"
data <- mds_ts[[1]]
data$rate <- ifelse(is.na(data$nA), 0, data$nA) / data$exposure
a3 <- poisson_rare(data, c("Rate"="rate"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.