Learn R Programming

SimNPH (version 0.5.6)

summarise_test: Generic summarise function for tests

Description

Generic summarise function for tests

Usage

summarise_test(alpha, name = NULL)

Value

A function that can be used in Summarise that returns a data frame with the columns

  • rejection_X

  • rejection_Y

  • ...

Where X, Y, ... are the alpha levels given in the argument

Arguments

alpha

the significance level(s)

name

name for the summarise function, appended to the name of the analysis method in the final results

Examples

Run this code
# \donttest{
condition <- merge(
  assumptions_delayed_effect(),
  design_fixed_followup(),
  by=NULL
) |>
  tail(4) |>
  head(1)

summarise_all <- create_summarise_function(
  logrank=summarise_test(alpha=c(0.5, 0.9, 0.95, 0.99))
)

# runs simulations
sim_results <- runSimulation(
  design=condition,
  replications=100,
  generate=generate_delayed_effect,
  analyse=list(
    logrank=analyse_logrank()
  ),
  summarise = summarise_all
)

sim_results[, grepl("rejection", names(sim_results))]
# }

Run the code above in your browser using DataLab