
Robust (M/MM-Estimator) Regression Inference for Continuous Responses
Source:R/inference_continuous_robust_regr.R
InferenceContinRobustRegr.RdFits a robust linear regression — by default via this package's
fast_robust_regression_cpp C++ backend (use_rcpp = TRUE;
see that page for the full M/MM-estimator model, weight functions, and
asymptotic variance formula), or via MASS::rlm when use_rcpp =
FALSE — for a continuous response using the treatment indicator and,
optionally, all recorded covariates as predictors. This provides a
Huber/MM-style robustness upgrade over ordinary least squares when outcomes
are heavy-tailed or outlier-prone, down-weighting large residuals rather
than letting them dominate the fit the way squared-error loss does.
The method argument is passed through to either backend and may be
either "M" (Huber's psi function) or "MM" (Tukey's bisquare
weight, the default — higher breakdown point than "M" at some cost
in asymptotic efficiency under normality). When use_rcpp = TRUE
(the default), coefficient standard errors come from the C++ backend's own
M-estimator asymptotic variance (ssq_b_j); when FALSE, they
come from the coefficient table returned by summary.rlm(). Either
way, confidence intervals and p-values use that standard error with
residual degrees of freedom \(n - p\) in a normal-theory Wald
approximation (not an exact finite-sample distribution).
Small-sample behaviour
How fast the size (and coverage) error of each procedure is expected to vanish as the
effective sample size \(n_{eff}\) grows, from EDI's convergence-rate registry
(inference_convergence_expectation()). Exact procedures are valid at every
n by construction; the others are asymptotic, so a small-sample excess is expected, and
its constant is not given by an order. The table is the expectation for a balanced
complete-randomization design; it is not a measured size. Reference keys are explained
under References.
| Procedure | Regime | Error order | Effective n | Regularity | Basis | References |
rand | finite sample | exact | subjects | regular | theory | [Fisher1935], [LehmannRomano2005] |
wald | asymptotic | unknown | subjects | other | unknown | [Huber1981] |
jackknife | asymptotic | unknown | subjects | other | unknown | [Huber1981] |
bootstrap | asymptotic | unknown | subjects | other | unknown | [Huber1981] |
bayes_boot | asymptotic | unknown | subjects | other | unknown | [Huber1981] |
rand_bootstrap | asymptotic | unknown | subjects | other | unknown | [Huber1981] |
The point estimate's bias is of order \(O(n_{eff}^{-1})\) (assumed default: [CoxSnell1968]).
Rows with order unknown: no rate is known for this class and procedure, so none is claimed; the cited works describe the non-standard limit, not a rate. Expect a small-sample excess of unquantified size.
Regularity other: a non-standard limit or an estimated scale, so the regular-model rate is not established.
Design-specific differences from the table:
On any design with unequal allocation (
prob_Tnot 0.5), forwald,jackknife,bootstrap,bayes_boot,rand_bootstrap: the effective n is the size of the smaller arm.On
DesignFixedBlockedCluster,DesignFixedCluster, forwald,jackknife,bootstrap,bayes_boot,rand_bootstrap: the effective n is the number of clusters.
Blocking designs
On a blocking design
(DesignFixedBlocking and relatives)
the regression-type inference classes do not add block fixed effects
(or block-by-treatment interactions) automatically: the model uses only the
covariate matrix. Whether the blocks enter the regression therefore depends
on how they were supplied: not at all with m=; as dummies when the
blocking column is a factor/character (or few-level integer) covariate; as a
single linear term when it is numeric. Randomization, bootstrap and
jackknife inference are block-aware regardless; only the model-based
(asymptotic, likelihood) path ignores the blocks.
When the proportion treated is the same in every block, the pooled
treatment estimate of a linear model is unbiased and its model-based SE is
conservative (it is inflated by the block variation it fails to remove), at a
cost in power. If the proportion treated differs across blocks (for example
equal_block_sizes = FALSE with very small blocks and an extreme
prob_T, where per-block rounding changes the allocation, or a
user-supplied m), the pooled treated-vs-control comparison is
confounded by block (Simpson's paradox) and can be biased; then include the
blocking covariate(s) explicitly as factor covariates. For non-linear models
(GLM, ordinal, survival) omitting blocks changes the estimand to a
block-marginal effect. See DesignFixedBlocking.
References
[Fisher1935] Fisher, R. A. (1935). The Design of Experiments. Oliver and Boyd.
[LehmannRomano2005] Lehmann, E. L., and Romano, J. P. (2005). Testing Statistical Hypotheses (3rd ed.). Springer.
[Huber1981] Huber, P. J. (1981). Robust Statistics. Wiley.
[CoxSnell1968] Cox, D. R., and Snell, E. J. (1968). "A General Definition of Residuals." Journal of the Royal Statistical Society: Series B, 30(2), 248-265 (discussion 265-275).
Super class
Inference -> InferenceContinRobustRegr
Methods
+ inherited public methods from Inference
Inference$capabilities()Inference$clear_randomization_cache()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_estimand()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_procedure_validity()Inference$get_response()Inference$get_response_type()Inference$get_summary()Inference$get_supported_estimands()Inference$get_treatment()Inference$is_nonestimable()Inference$set_estimand()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceContinRobustRegr$new()
Uses the shared randomization two-sided p-value contract; see
InferenceRand.
Initialize a robust-regression inference object for a completed design with a continuous, uncensored response.
Usage
InferenceContinRobustRegr$new(
des_obj,
model_formula = NULL,
method = "MM",
use_rcpp = TRUE,
verbose = FALSE,
smart_cold_start_default = NULL
)Arguments
des_objA completed
Designobject with a continuous response.model_formulaOptional 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.methodRobust estimation method,
"M"(Huber) or"MM"(Tukey bisquare, higher breakdown point). Default"MM".use_rcppWhether to use the
fast_robust_regression_cppC++ backend (TRUE, default) instead ofMASS::rlm(FALSE).verboseWhether to print progress messages. Default
FALSE.smart_cold_start_defaultWhether to use smart starting values for the optimizer.
InferenceContinRobustRegr$compute_estimate()
Computes the robust-regression treatment coefficient
\(\hat\beta_T\) from an M/MM-estimator fit (see class documentation
for the full model and use_rcpp backend choice). Rank-deficient
covariate columns are dropped before fitting via
private$fit_with_hardened_qr_column_dropping().
InferenceContinRobustRegr$compute_estimate_with_bootstrap_weights()
Recomputes the robust-regression treatment estimate under
subject/block bootstrap weights, used by the Bayesian bootstrap and
related weighted-resampling machinery; see
InferenceBayesianBootstrap.
When use_rcpp = TRUE, reproduces MASS::rlm's default
wt.method = "inv.var" weighting exactly by pre-multiplying
X and y by \(\sqrt{\text{weight}}\) and running
unweighted M-estimation on the transformed data via the C++ backend
(rather than adding native weight support to that backend); when
use_rcpp = FALSE, passes weights directly to
MASS::rlm. This variant never populates a standard error or
degrees of freedom (both left NA) — it is estimate-only by
construction, matching the estimate_only default of the fast
path it always uses internally.
InferenceContinRobustRegr$compute_asymp_confidence_interval()
Computes a \(1-\alpha\) level confidence interval for the
robust-regression treatment coefficient \(\hat\beta_T\), using the
M/MM-estimator's asymptotic standard error (see class documentation
for its source depending on use_rcpp) and residual degrees of
freedom \(n - p\) in a normal-theory Wald approximation. See
InferenceAsymp for the shared
asymptotic confidence-interval contract this delegates to.
InferenceContinRobustRegr$compute_asymp_two_sided_pval()
Computes a two-sided Wald p-value testing \(H_0:
\beta_T = \code{delta}\), from the same M/MM-estimator standard error
and residual degrees of freedom used by
$compute_asymp_confidence_interval(). See
InferenceAsymp for the shared
asymptotic two-sided p-value contract this delegates to.
Examples
# \donttest{
seq_des = DesignSeqOneByOneBernoulli$new(n = 10, response_type = 'continuous')
for (i in 1:10) {
seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
}
seq_des$add_all_subject_responses(rnorm(10))
inf = InferenceContinRobustRegr$new(seq_des)
inf$compute_estimate()
#> [1] -1.005197
# }