Validate a Sample Size Analysis
This function can be used to validate the recommendation obtained from a sample size analysis.
validate( method, replications = 3000, cores = NULL, backend_type = NULL, verbose = TRUE )
|An object of class |
|A single positive integer representing the number of Monte Carlo simulations to perform for the recommended sample size. The default is |
|A single positive positive integer representing the number of cores to use for running the validation in parallel, or |
|A character string indicating the type of cluster to create for running the validation in parallel, or |
|A logical value indicating whether information about the status of the validation should be printed while running. The default is |
The sample sizes used during the validation procedure is automatically extracted from the
R6::R6Class instance of
Validation class that contains the results of the validation. Suppose the instance is stored in a variable named
validation, then specific fields of the
Validation class can be accessed as
The following main fields can be accessed:
$sample: The sample size used for the validation.
$measures: The performance measures observed during validation.
$statistic: The statistic computed on the performance measures.
$percentile_value: The performance measure value at the desired percentile.
# Plot validation results. plot(validation)
# Perform a sample size analysis. results <- powerly( range_lower = 300, range_upper = 1000, samples = 40, replications = 40, measure = "sen", statistic = "power", measure_value = .6, statistic_value = .8, model = "ggm", nodes = 10, density = .4, cores = 4, verbose = TRUE ) # Validate the recommendation obtained during the analysis. validation <- validate(results, cores = 2) # Plot the validation results. plot(validation) # To see a summary of the validation, we can use the `summary` S3 method. summary(validation)