
Randomization test/CI on a user-supplied statistic
Source:R/inference_rand_custom.R
InferenceRandCustom.RdRuns a randomization test (and, via compute_rand_confidence_
interval(), a randomization confidence interval) for an arbitrary
user-supplied statistic, without writing an Inference subclass.
The statistic function is called once per permutation as
fn(y, w, dead) – plain numeric/integer vectors: the current
(possibly permuted) response, treatment assignment, and event indicator.
It must return one scalar. For maximum speed, supply
custom_randomization_statistic_cpp instead: C++ source defining a
function of (NumericVector y, IntegerVector w) or
(NumericVector y, IntegerVector w, IntegerVector dead) returning a
scalar double, using the same convention as
DesignFixedOptimal's custom_objective.
Only a randomization test and randomization confidence interval are available – there is no package point-estimator, Wald path, or bootstrap machinery on this class, so no other action needs disabling.
Super classes
Inference -> InferenceCustomRand -> InferenceRandCustom
Methods
+ inherited public methods from InferenceCustomRand
+ inherited public methods from Inference
Inference$capabilities()Inference$compute_asymp_confidence_interval()Inference$compute_asymp_two_sided_pval()Inference$compute_exact_confidence_interval()Inference$compute_exact_two_sided_pval_for_treatment_effect()Inference$duplicate()Inference$get_analysis_data()Inference$get_covariates()Inference$get_design_object()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_response()Inference$get_response_type()Inference$get_treatment()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceRandCustom$new()
Initialize.
Usage
InferenceRandCustom$new(
des_obj,
custom_randomization_statistic_function = NULL,
custom_randomization_statistic_cpp = NULL,
verbose = FALSE
)