Skip to contents

Runs 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


InferenceRandCustom$new()

Initialize.

Usage

InferenceRandCustom$new(
  des_obj,
  custom_randomization_statistic_function = NULL,
  custom_randomization_statistic_cpp = NULL,
  verbose = FALSE
)

Arguments

des_obj

See class description.

custom_randomization_statistic_function

See class description.

custom_randomization_statistic_cpp

See class description.

verbose

See class description.


InferenceRandCustom$fit()

Calls the user-supplied statistic on the observed data.

Usage

InferenceRandCustom$fit(estimate_only = FALSE)

Arguments

estimate_only

Unused; present for the `fit()` contract.


InferenceRandCustom$clone()

The objects of this class are cloneable with this method.

Usage

InferenceRandCustom$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.