Skip to contents

Intermediate 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.

Methods

+ inherited public methods from InferenceMLEorKMSummaryTable
+ inherited public methods from InferenceAsymp
+ inherited public methods from InferenceJackknife
+ inherited public methods from InferenceBayesianBootstrap
+ inherited public methods from InferenceRandBootstrapCI
+ inherited public methods from InferenceRandBootstrap
+ inherited public methods from InferenceNonParamBootstrap
+ 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


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.

Usage

InferenceAsympLik$compute_asymp_confidence_interval(alpha = 0.05)

Arguments

alpha

Significance level 1 - alpha. Default 0.05.

Returns

A confidence interval.


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.

Usage

InferenceAsympLik$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect to test against. Default 0.

Returns

The asymptotic p-value.


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")
)

Arguments

testing_type

One of "wald", "score", "gradient", "lik_ratio", "lik_ratio_bartlett_approx", or "lik_ratio_bartlett_exact".

Returns

The inference object, invisibly.


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")
)

Arguments

information_preference

One of "auto", "fisher", or "observed".

Returns

The inference object, invisibly.


InferenceAsympLik$get_testing_type()

Gets the asymptotic testing method used by p-values and CIs.

Usage

InferenceAsympLik$get_testing_type()


InferenceAsympLik$get_information_preference()

Gets the score-test information matrix preference.

Usage

InferenceAsympLik$get_information_preference()


InferenceAsympLik$get_information_source_used()

Gets the actual information source used by the most recent information-backed computation.

Usage

InferenceAsympLik$get_information_source_used()


InferenceAsympLik$get_supported_testing_types()

Gets the asymptotic testing methods supported by this inference object.

Usage

InferenceAsympLik$get_supported_testing_types()


InferenceAsympLik$get_supported_information_preferences()

Gets the score-test information matrix preferences supported by this inference object.

Usage

InferenceAsympLik$get_supported_information_preferences()


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.

Usage

InferenceAsympLik$compute_score_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect.


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.

Usage

InferenceAsympLik$compute_score_confidence_interval(alpha = 0.05)

Arguments

alpha

Significance level. Default 0.05.


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.

Usage

InferenceAsympLik$compute_lik_ratio_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect.


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.

Usage

InferenceAsympLik$compute_lik_ratio_confidence_interval(alpha = 0.05)

Arguments

alpha

Significance level. Default 0.05.


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).

Usage

InferenceAsympLik$compute_lik_ratio_bartlett_approx_two_sided_pval(
  delta = 0,
  B = 99
)

Arguments

delta

Null treatment effect. Default 0.

B

Number of Monte-Carlo replicates used to estimate the Bartlett factor. Default 99.


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.

Usage

InferenceAsympLik$compute_lik_ratio_bartlett_approx_confidence_interval(
  alpha = 0.05,
  B = 99
)

Arguments

alpha

Significance level. Default 0.05.

B

Number of Monte-Carlo replicates used to estimate the Bartlett factor. Default 99.


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.

Usage

InferenceAsympLik$compute_lik_ratio_bartlett_exact_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect. Default 0.


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.

Usage

InferenceAsympLik$compute_lik_ratio_bartlett_exact_confidence_interval(
  alpha = 0.05
)

Arguments

alpha

Significance level. Default 0.05.


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.

Usage

InferenceAsympLik$compute_lik_ratio_bartlett_two_sided_pval(delta = 0, B = 99)

Arguments

delta

Null treatment effect. Default 0.

B

Number 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 B has no effect), a warning is issued; B left 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.

Usage

InferenceAsympLik$compute_lik_ratio_bartlett_confidence_interval(
  alpha = 0.05,
  B = 99
)

Arguments

alpha

Significance level. Default 0.05.

B

Number of Monte-Carlo replicates, used only when the exact factor is unavailable and the approximate factor is used instead. Default 99.


InferenceAsympLik$compute_gradient_two_sided_pval()

Computes the gradient two-sided p-value regardless of configured testing type.

Usage

InferenceAsympLik$compute_gradient_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect.


InferenceAsympLik$compute_gradient_confidence_interval()

Computes the gradient confidence interval regardless of configured testing type.

Usage

InferenceAsympLik$compute_gradient_confidence_interval(alpha = 0.05)

Arguments

alpha

Significance level. Default 0.05.


InferenceAsympLik$clone()

The objects of this class are cloneable with this method.

Usage

InferenceAsympLik$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.