Skip to contents

A variance-weighted compound quantile regression estimator for KK matching-on-the-fly designs with proportion responses. Inference is performed on the logit (log-odds) scale: responses \(y \in (0,1)\) are transformed via \(\text{logit}(y) = \log(y/(1-y))\) before quantile regression.

The estimator combines:

  1. Quantile regression on logit-scale within-pair differences \(\text{logit}(y_T) - \text{logit}(y_C)\) (matched pairs)

  2. Quantile regression of \(\text{logit}(y)\) on treatment and covariates (reservoir)

using the same variance-weighted combination logic as the OLS compound estimator.

The estimated treatment effect is a log-odds-ratio shift at quantile tau.

Default quantile: tau = 0.5 (median regression). To target a different quantile — for example the 25th or 75th percentile — pass tau = 0.25 or tau = 0.75 to the constructor:


  inf = InferencePropKKQuantileRegrIVWC$
  new(seq_des, tau = 0.75)

Any value strictly between 0 and 1 is accepted.

Standard errors use Powell's "nid" sandwich estimator (non-iid), falling back to "iid" on failure. Asymptotic z-based inference is used throughout.

This class requires the quantreg package, which is listed in Suggests and is not installed automatically with EDI. Install quantreg before using this class.

Legacy class. Not fully tested in comprehensive_tests.R.

Bayesian bootstrap. Each Bayesian-bootstrap replicate is a weighted refit of this estimator: under the draw's Dirichlet weights (a matched pair's weight is the mean of its two subjects' row weights) both halves are refit by weighted quantile regression (quantreg::rq(weights = )) (on the logit scale). Each half's standard error comes from its weighted fit (the "nid" sandwich, then "iid", then a weighted-IQR fallback) and the two halves are pooled by inverse variance exactly as in compute_estimate(). Units with a zero weight, or one below \(10^{-10}\) times the mean weight, are dropped from the refit; the remaining weights are rescaled to mean 1 (the coefficients do not depend on the scale, and uniform weights then reproduce the unweighted fit and its standard errors).

Super class

Inference -> InferencePropKKQuantileRegrIVWC

Methods

+ inherited public methods from Inference


InferencePropKKQuantileRegrIVWC$new()

Initialize proportion-response KK IVWC quantile-regression inference on the logit response scale; see InferencePropKKQuantileRegrIVWC.

Usage

InferencePropKKQuantileRegrIVWC$new(
  des_obj,
  model_formula = NULL,
  tau = 0.5,
  verbose = FALSE,
  smart_cold_start_default = NULL
)

Arguments

des_obj

A DesignSeqOneByOne object whose entire n subjects are assigned and response y is recorded within.

model_formula

Optional formula for covariate adjustment. If NULL (default), the formula from the design object is used and its pre-computed design matrix is reused. If a formula is provided, a new design matrix is constructed from the design's imputed covariates.

tau

The quantile level for regression on the logit scale, strictly between 0 and 1. The default tau = 0.5 estimates the median log-odds-ratio treatment effect. Pass a different value (e.g. tau = 0.25 or tau = 0.75) to target a different percentile of the treatment effect distribution.

verbose

A flag indicating whether messages should be displayed to the user. Default is FALSE.

smart_cold_start_default

Whether to use smart cold start values.


InferencePropKKQuantileRegrIVWC$clone()

The objects of this class are cloneable with this method.

Usage

InferencePropKKQuantileRegrIVWC$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (requireNamespace("quantreg", quietly = TRUE)) {
# \donttest{
seq_des = DesignSeqOneByOneKK14$new(n = 10, response_type = 'proportion')
for (i in 1:10) {
  seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1), x2 = rnorm(1)))
}
seq_des$add_all_subject_responses(runif(10))
inf = InferencePropKKQuantileRegrIVWC$new(seq_des)
inf$compute_estimate()
# }
}
#> [1] 1.302767