
Likelihood-Backed Asymptotic Inference
Source:R/inference_all_abstract_asymp_lik.R
InferenceAsympLik.RdIntermediate base class for asymptotic inference families that expose
likelihood / partial-likelihood / working-likelihood test paths in addition
to Wald inference. The term "likelihood" is used broadly: subclasses may be
backed by a true full likelihood, a partial likelihood (e.g. Cox PH), a
quasi-likelihood (e.g. GEE, quasi-Poisson), or a composite/combined
likelihood. Classes requiring a full generative likelihood — i.e. those
supporting parametric-bootstrap LR calibration — inherit instead from
InferenceParamBootstrap.
Super classes
Inference -> InferenceRand -> InferenceRandCI -> InferenceNonParamBootstrap -> InferenceRandBootstrap -> InferenceRandBootstrapCI -> InferenceBayesianBootstrap -> InferenceJackknife -> InferenceAsymp -> InferenceMLEorKMSummaryTable -> InferenceAsympLik
Methods
Public methods
InferenceAsympLik$compute_lik_ratio_bartlett_approx_two_sided_pval()InferenceAsympLik$compute_lik_ratio_bartlett_approx_confidence_interval()InferenceAsympLik$compute_lik_ratio_bartlett_exact_two_sided_pval()InferenceAsympLik$compute_lik_ratio_bartlett_exact_confidence_interval()InferenceAsympLik$compute_lik_ratio_bartlett_two_sided_pval()InferenceAsympLik$compute_lik_ratio_bartlett_confidence_interval()
+ inherited public methods from InferenceMLEorKMSummaryTable
+ inherited public methods from InferenceAsymp
+ inherited public methods from InferenceJackknife
InferenceJackknife$approximate_jackknife_distribution_beta_hat_T()InferenceJackknife$compute_jackknife_bias_estimate()InferenceJackknife$compute_jackknife_estimate()InferenceJackknife$compute_jackknife_std_error()InferenceJackknife$compute_jackknife_wald_confidence_interval()InferenceJackknife$compute_jackknife_wald_two_sided_pval()+ inherited public methods from InferenceBayesianBootstrap
InferenceBayesianBootstrap$approximate_bayesian_bootstrap_distribution_beta_hat_T()InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval()InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval()InferenceBayesianBootstrap$compute_estimate_with_bootstrap_weights()InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_ci_types()InferenceBayesianBootstrap$get_supported_bayesian_bootstrap_pval_types()+ inherited public methods from InferenceRandBootstrapCI
+ inherited public methods from InferenceRandBootstrap
+ inherited public methods from InferenceNonParamBootstrap
InferenceNonParamBootstrap$approximate_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$approximate_m_out_of_n_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$approximate_subsampling_distribution_beta_hat_T()InferenceNonParamBootstrap$compute_bootstrap_confidence_interval()InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_subsampling_confidence_interval()InferenceNonParamBootstrap$compute_subsampling_sensitivity()InferenceNonParamBootstrap$compute_subsampling_two_sided_pval()InferenceNonParamBootstrap$get_supported_bootstrap_ci_types()InferenceNonParamBootstrap$get_supported_bootstrap_pval_types()InferenceNonParamBootstrap$select_optimal_b_subsampling()InferenceNonParamBootstrap$select_optimal_m_out_of_n_bootstrap()+ inherited public methods from InferenceRandCI
InferenceRandCI$compute_rand_confidence_interval()InferenceRandCI$compute_rand_two_sided_pval()+ inherited public methods from InferenceRand
+ inherited public methods from Inference
Inference$capabilities()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$initialize()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceAsympLik$compute_asymp_confidence_interval()
Computes an asymptotic confidence interval for the treatment
effect using the configured likelihood-backed test. Wald intervals use
the fitted estimate and standard error; score, likelihood-ratio,
gradient, and Bartlett-corrected likelihood-ratio intervals are obtained
by inverting the corresponding test. For purely Wald asymptotic dispatch,
see InferenceAsymp.
InferenceAsympLik$compute_asymp_two_sided_pval()
Computes an asymptotic two-sided p-value for the treatment
effect using the configured likelihood-backed test. Depending on
testing_type, this evaluates a Wald, score, likelihood-ratio,
gradient, or Bartlett-corrected likelihood-ratio statistic under the
null value delta. For count-specific likelihood families, see
InferenceCountLikelihood.
InferenceAsympLik$set_testing_type()
Sets the asymptotic testing method used by p-values and CIs.
Usage
InferenceAsympLik$set_testing_type(
testing_type = c("wald", "score", "gradient", "lik_ratio", "lik_ratio_bartlett_approx",
"lik_ratio_bartlett_exact")
)InferenceAsympLik$set_information_preference()
Sets the information matrix preference used by score-test dispatch.
Usage
InferenceAsympLik$set_information_preference(
information_preference = c("auto", "fisher", "observed")
)InferenceAsympLik$get_information_source_used()
Gets the actual information source used by the most recent information-backed computation.
InferenceAsympLik$get_supported_testing_types()
Gets the asymptotic testing methods supported by this inference object.
InferenceAsympLik$get_supported_information_preferences()
Gets the score-test information matrix preferences supported by this inference object.
InferenceAsympLik$compute_score_two_sided_pval()
Computes the score two-sided p-value regardless of configured
testing type. The score test evaluates the null-restricted fit and uses
the configured information matrix preference; compare with
compute_asymp_two_sided_pval() for configured-test dispatch.
InferenceAsympLik$compute_score_confidence_interval()
Computes the score confidence interval regardless of configured
testing type by inverting score-test p-values over candidate treatment
effects. Compare with compute_asymp_confidence_interval() for
configured-test dispatch.
InferenceAsympLik$compute_lik_ratio_two_sided_pval()
Computes the likelihood-ratio two-sided p-value regardless of
configured testing type. This compares unrestricted and null-restricted
fits at delta; subclasses may use a full, partial, quasi-, or
composite likelihood as described in
InferenceAsympLik.
InferenceAsympLik$compute_lik_ratio_confidence_interval()
Computes the likelihood-ratio confidence interval regardless of configured testing type by inverting likelihood-ratio p-values over candidate treatment effects. Compare with score and gradient intervals in this class.
InferenceAsympLik$compute_lik_ratio_bartlett_approx_two_sided_pval()
Computes the approximate (Monte-Carlo) Bartlett-corrected likelihood-ratio
two-sided p-value regardless of configured testing type. Returns NA_real_
for subclasses that do not implement an approximate Bartlett correction factor.
The approximate Bartlett factor is estimated by Monte Carlo (e.g. the generic
InferenceParamBootstrap factor): B datasets are simulated under
the null-restricted fit at delta and refit to approximate
E[LR | H0], the quantity a classical analytic Bartlett correction
targets exactly. The Monte-Carlo draws are seeded from this object's own
seed (see set_seed()), so repeated calls at the same
delta with the same B are reproducible; there is no separate
seed argument here.
See compute_lik_ratio_bartlett_exact_two_sided_pval() for the
closed-form analytic counterpart (no simulation, no B).
InferenceAsympLik$compute_lik_ratio_bartlett_approx_confidence_interval()
Computes the approximate (Monte-Carlo) Bartlett-corrected likelihood-ratio
confidence interval regardless of configured testing type. Returns
c(NA_real_, NA_real_) for subclasses that do not implement an
approximate Bartlett correction factor.
See compute_lik_ratio_bartlett_approx_two_sided_pval() for what
B controls and how the Monte-Carlo seed is inherited from this
object's own seed. Each p-value evaluation during the
confidence-interval search re-simulates B replicates, so this can
be substantially more expensive than the p-value alone.
InferenceAsympLik$compute_lik_ratio_bartlett_exact_two_sided_pval()
Computes the exact (closed-form analytic) Bartlett-corrected
likelihood-ratio two-sided p-value regardless of configured testing type.
Returns NA_real_ for subclasses that do not implement an exact,
bespoke analytic Bartlett correction factor. Concrete families opt in
through get_bartlett_factor_exact().
Unlike compute_lik_ratio_bartlett_approx_two_sided_pval(), this path
involves no simulation and no Monte-Carlo replicate count.
InferenceAsympLik$compute_lik_ratio_bartlett_exact_confidence_interval()
Computes the exact (closed-form analytic) Bartlett-corrected
likelihood-ratio confidence interval regardless of configured testing type.
Returns c(NA_real_, NA_real_) for subclasses that do not implement an
exact, bespoke analytic Bartlett correction factor.
InferenceAsympLik$compute_lik_ratio_bartlett_two_sided_pval()
Computes "the best available" Bartlett-corrected likelihood-ratio
two-sided p-value regardless of configured testing type: uses the exact
(closed-form analytic) factor if this class implements one, otherwise
falls back to the approximate (Monte-Carlo) factor. Errors if the class
supports neither (see supports_bartlett_likelihood_ratio_exact()/
supports_bartlett_likelihood_ratio_approx()).
This is a convenience entry point for callers who want a Bartlett-corrected
p-value without caring which mechanism produced it. Because exact and
approximate factors are computed differently (deterministic closed form vs.
seeded Monte-Carlo simulation), the same call can silently start
returning different numeric results on a future package version once a
family gains an exact implementation where previously only the
approximate path existed. Callers who need results stable across package
versions (e.g. for reproducibility or regression tests) should call
compute_lik_ratio_bartlett_approx_two_sided_pval() or
compute_lik_ratio_bartlett_exact_two_sided_pval() directly instead.
Arguments
deltaNull treatment effect. Default 0.
BNumber of Monte-Carlo replicates, used only when the exact factor is unavailable and the approximate factor is used instead. If explicitly supplied but the exact factor is used (so
Bhas no effect), a warning is issued;Bleft at its default is silently ignored in that case. Default 99.
InferenceAsympLik$compute_lik_ratio_bartlett_confidence_interval()
Computes "the best available" Bartlett-corrected likelihood-ratio confidence interval regardless of configured testing type: uses the exact (closed-form analytic) factor if this class implements one, otherwise falls back to the approximate (Monte-Carlo) factor. Errors if the class supports neither.
See compute_lik_ratio_bartlett_two_sided_pval() for the exact-over-approx
selection rule, the B-ignored warning behavior, and why callers who
need version-to-version reproducibility should prefer the explicit
_approx/_exact methods instead.
InferenceAsympLik$compute_gradient_two_sided_pval()
Computes the gradient two-sided p-value regardless of configured testing type.
InferenceAsympLik$compute_gradient_confidence_interval()
Computes the gradient confidence interval regardless of configured testing type.