Inspects data structure and recommends an appropriate resampling method.
Usage
auto_select_method(data, cluster = NULL)
Value
A list with two character string elements:
method
recommended resampling method name. Values:
"clustered_boot" (if cluster provided),
"block_boot" (if time series detected),
"perm_maxT" (if multivariate matrix detected),
"nonparametric_boot" (default for IID univariate data)
rationale
human-readable explanation of recommendation.
Describes why chosen method is appropriate and what structure
the data exhibits.
Arguments
data
numeric vector, matrix, or time series object representing data
to analyze. For vectors: univariate sample. For matrices/data.frames:
multivariate data with rows=observations, columns=variables.
For ts objects: automatically detected as time series.
cluster
optional vector of cluster IDs (integer or factor).
Length must equal nrow(data) for matrices or length(data) for vectors.
Identifies hierarchical grouping (e.g., repeated measures within subjects,
multiple samples from same source). If NULL (default), clustering is not
considered. If provided, triggers clustered bootstrap recommendation.
Details
Decision logic:
- If clusters provided: use clustered bootstrap
- If time series detected: use block or stationary bootstrap
- If multivariate matrix: use permutation maxT
- Otherwise (IID data): use standard nonparametric bootstrap