Learn R Programming

mdsstat (version 0.3.2)

run_algos: Run Multiple Algorithms

Description

Run a multiple number of mdsstat algorithms on a single input dataset.

Usage

run_algos(data, algos, dataframe = T, non_dpa = "skip", ...)

# S3 method for list run_algos(data, algos, dataframe = T, non_dpa = "skip", ...)

# S3 method for default run_algos(data, algos, dataframe = T, non_dpa = "skip", ...)

Arguments

data

Required input dataset. Note that the dataset must satisfy the dataset requirements for each algorithm specified (parameter df). An mds times series object (class mds_ts) is a natural fit.

algos

Input list of algorithms to run. Must be a list generated by define_algos.

dataframe

Logical on whether to output results as a mdsstat_tests data frame. If FALSE, will output as a list of mdsstat_test lists.

Default: TRUE

non_dpa

What to do when input data is not prepared for disproportionality analysis (DPA) data. Three values are accepted: "skip", "warn", and "stop". "skip" skips the DPA test without warnings or errors. "warn" outputs a warning and then skips the DPA test. "stop" stops the function call.

Default: "skip"

...

Further arguments for future work.

Value

A mdsstat_tests data frame or list of mdsstat_test lists with the results of the algorithm runs.

Methods (by class)

  • list: Run algorithms on a list of time series

  • default: Run algorithms on a single time series

Examples

Run this code
# NOT RUN {
data <- mds_ts[[1]]
data$rate <- data$nA / data$exposure
x <- list(prr=list(),
  xbar=list(),
  xbar=list(ts_event=c(Rate="rate"), we_rule=2),
  poisson_rare=list(p_rate=0.3))
algos <- define_algos(x)
run_algos(data, algos)
run_algos(data, algos, FALSE)
# }

Run the code above in your browser using DataLab