Treatment Effects#
Treatment effect estimators.
- class pyrake.estimation.treatment_effects.DoubleSamplingEstimand(estimand1, estimand2)[source]#
Bases:
EstimandEstimand combining two sampling mechanisms.
- Parameters:
estimand1 (
SimpleEstimand) – The two sampling-mechanism estimands whose weights multiply.estimand2 (
SimpleEstimand) – The two sampling-mechanism estimands whose weights multiply.
- property weights#
Calculate weights based on propensity scores.
- Returns:
weights – Elementwise product of the two mechanism weight vectors.
- Return type:
(M,)
npt.NDArray[np.float64]
- sensitivity_region(gamma)[source]#
Calculate a sensitivity region around baseline weights.
- Parameters:
gamma (float) – The Gamma factor. Must be >= 1.0.
- Returns:
lower, upper – Elementwise products of the two mechanisms’ bound vectors.
- Return type:
(M,)
npt.NDArray[np.float64]
- resample(bootstrap_indices)[source]#
Create a new Estimand object based on resampled indices.
- Parameters:
bootstrap_indices ((B,)
npt.NDArray[np.int64]) – Row positions to retain in the resampled estimand.- Returns:
estimand – New estimand built from the indexed rows of both mechanisms.
- Return type:
DoubleSamplingEstimand
- static normalizing_factor(sample_size, population_size)[source]#
Calculate normalizing factor.
- Raises:
NotImplementedError – Always raised; double sampling has no single normalizing factor.
- class pyrake.estimation.treatment_effects.TreatmentEffectEstimator(control_estimator, treated_estimator)[source]#
Bases:
WeightingEstimatorEstimator for the difference between treated and control means.
- Parameters:
control_estimator (
MeanEstimatororRatioEstimator) – Estimators for the control- and treated-group quantities. The point estimate is their difference.treated_estimator (
MeanEstimatororRatioEstimator) – Estimators for the control- and treated-group quantities. The point estimate is their difference.
- point_estimate()[source]#
Calculate a point estimate.
- Returns:
estimate – Treated point estimate minus control point estimate.
- Return type:
- variance()[source]#
Calculate the variance.
- Returns:
variance – Sum of the treated and control sampling variances.
- Return type:
- pvalue(null_value=0.0, alternative='two-sided')[source]#
Calculate a p-value.
Computes a p-value against the null hypothesis:
H0: TE = ``null_value``,
where TE is the treatment effect.
- Parameters:
null_value (float) – The hypothesized treatment effect.
alternative (["two-sided", "less", "greater"], optional) –
What kind of test:
”two-sided”: H0: TE =
null_valuevs Halt: TE <>null_value.”greater”: H0: TE <=
null_valuevs Halt: TE >null_value.”less”: H0: TE >=
null_valuevs Halt: TE <null_value.
For example, specifying alternative = “greater” returns a p-value that quantifies the strength of evidence against the null hypothesis that the treatment effect is less than
null_value, in favor of the alternative hypothesis that the treatment effect is actually greater thannull_value. Defaults to “two-sided”.
- Returns:
p – P-value.
- Return type:
- Raises:
ValueError – If
alternativeis not recognized (propagated frompvalue).
- adjusted_pvalue(null_value=0.0, gamma=6.0, alternative='two-sided', bootstrap=True, B=1000, seed=None)[source]#
Calculate a p-value adjusted for hidden bias.
See
WeightingEstimator.adjusted_pvaluefor full documentation.- Parameters:
null_value (float, optional) – The hypothesized treatment effect. Defaults to 0.0.
gamma (float, optional) – The Gamma factor. Must be >= 1.0. Defaults to 6.
alternative (["two-sided", "less", "greater"], optional) – Defaults to “two-sided”.
bootstrap (bool, optional) – If True (default), use the percentile bootstrap. If False, use the normal approximation (no resampling).
B (int, optional) – Number of bootstrap replications. Ignored when
bootstrap=False. Defaults to 1_000.seed (int, list_like, etc) – A seed for
numpy.random.default_rng. Ignored whenbootstrap=False.
- Returns:
p – Adjusted p-value.
- Return type:
- Raises:
ValueError – If
gamma< 1 oralternativeis not recognized (propagated fromWeightingEstimator.adjusted_pvalue).
- confidence_interval(alpha=0.1, alternative='two-sided')[source]#
Calculate confidence interval on the treatment effect.
- Parameters:
alpha (float, optional) – P-value threshold, e.g. specify alpha=0.05 for a 95% confidence interval. Defaults to 0.10, corresponding to a 90% confidence interval.
alternative (["two-sided", "less", "greater"], optional) –
What kind of test:
”two-sided”: H0: TE =
null_valuevs Halt: TE <>null_value.”greater”: H0: TE <=
null_valuevs Halt: TE >null_value.”less”: H0: TE >=
null_valuevs Halt: TE <null_value.
Defaults to “two-sided”.
- Returns:
lb, ub – Lower and upper bounds on the confidence interval. For one-sided intervals, only one of these will be finite:
”two-sided”: lb and ub both finite
”greater”: lb finite, ub = np.inf
”less”: lb = -np.inf, ub finite
- Return type:
- Raises:
ValueError – If
alternativeis not recognized (propagated fromconfidence_interval).
- sensitivity_analysis(gamma=6.0, outcome_proxies=None, proxy_mean=None, alpha=0.1, *, control_outcome_proxies=None, treated_outcome_proxies=None, **kwargs)[source]#
Perform a sensitivity analysis.
Calculate a range of point estimates implied by the Gamma factor.
- Parameters:
gamma (float, optional) – The Gamma factor. Must be >= 1.0, with 1.0 indicating perfect propensity scores. Defaults to 6. See Notes.
outcome_proxies (array_like, optional) – Accepted for override compatibility with
WeightingEstimator; must be None. Usecontrol_outcome_proxiesandtreated_outcome_proxiesinstead.proxy_mean (float, optional) – Known population mean of the outcome proxy. Required when either
control_outcome_proxiesortreated_outcome_proxiesis supplied.alpha (float, optional) – Significance level for the proxy tolerance. Defaults to 0.10.
control_outcome_proxies (array_like, optional) – A proxy for the outcome observed for every control-group unit, with a known population mean given by
proxy_mean. When supplied (together withtreated_outcome_proxiesandproxy_mean), a constraint is added to the control-arm sensitivity region requiring the weighted proxy estimate to be within the estimator’s confidence-interval half-width ofproxy_mean. Must have the same length as the control-group outcomes. All three ofcontrol_outcome_proxies,treated_outcome_proxies, andproxy_meanmust be provided together.treated_outcome_proxies (array_like, optional) – A proxy for the outcome observed for every treated-group unit. See
control_outcome_proxiesfor details.kwargs (dict, optional) – Accepted for override compatibility with
WeightingEstimator; must be empty.
- Returns:
lb, ub – Lower and upper bounds on the point estimate.
- Return type:
- Raises:
TypeError – If
outcome_proxiesor unexpected keyword arguments are supplied.ValueError – If proxies are supplied without
proxy_mean, ifproxy_meanis supplied without proxies, or ifgamma< 1 (propagated from the arm-levelsensitivity_analysiscalls).
Notes
The underlying sensitivity analysis is separable in the control vs treated individuals, so we perform two separate sensitivity analyses and combine the results.
- plot_sensitivity(gamma_lower=1.0, gamma_upper=6.0, num_points=50, alpha=0.1, alternative='two-sided', bootstrap=True, B=1000, null_value=0.0, title=None, ylabel='Sensitivity Interval', ytick_format='.0%', axis_label_size=None, tick_label_size=None, legend_label_size=None, legend_placement=None, ax=None)[source]#
Plot like
WeightingEstimator.plot_sensitivitywithnull_value0.
- class pyrake.estimation.treatment_effects.SimpleDifferenceEstimator(control_outcomes, treated_outcomes, control_sampling_propensity_scores=None, treated_sampling_propensity_scores=None, sampling_estimand_class='PopulationMean', control_denominator_outcomes=None, treated_denominator_outcomes=None, **kwargs)[source]#
Bases:
TreatmentEffectEstimatorSimple difference in means.
- Parameters:
control_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp.
treated_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp.
control_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the control group. See Notes.
treated_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the treated group. See Notes.
sampling_estimand_class (str, optional) – One of “PopulationMean”, “NonRespondentMean”, or “SampleMean”. Population for which to estimate the average treatment effect. Used only when sampling propensity scores are specified. Defaults to “PopulationMean” in that case. See Notes.
control_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes inATEEstimatorfor details.treated_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes inATEEstimatorfor details.kwargs (dict, optional) – Extra arguments forwarded to the estimator constructor.
Notes
When called without sampling propensity scores, this class computes the average response in treatment, minus the average response in control. No weights, just straight averages. This may be helpful to see how different the adjusted estimator is from the simplest comparison of treatment and control, to see how biased this simple estimator is.
In situations where the treatment is randomly assigned in the population (but potentially not in the sample), this estimator can also be used to generalize estimated treatment effects from the sample to the population (Tipton and Hartman, 2023). The basic strategy here is to use the control responses to estimate the average potential outcome Y(0) in the population, and the treated responses to estimate the average Y(1). Since treatment is randomly assigned in the population, the population average treatment effect is just the difference in these means.
References
Tipton, Elizabeth and Erin Hartman. 2023. “Generalizability and Transportability.” In Handbook of Matching and Weighting Adjustments for Causal Inference, , pg. 39–59. Chapman and Hall/CRC.
- class pyrake.estimation.treatment_effects.ATEEstimator(control_propensity_scores, control_outcomes, treated_propensity_scores, treated_outcomes, estimator_class='SIPW', control_estimator_class=None, treated_estimator_class=None, control_sampling_propensity_scores=None, treated_sampling_propensity_scores=None, sampling_estimand_class='PopulationMean', control_denominator_outcomes=None, treated_denominator_outcomes=None, control_kwargs=None, treated_kwargs=None, **kwargs)[source]#
Bases:
TreatmentEffectEstimatorEstimator for the average treatment effect.
- Parameters:
control_propensity_scores (list_like) – Propensity scores for control and treatment groups, resp.
treated_propensity_scores (list_like) – Propensity scores for control and treatment groups, resp.
control_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp. Should have the same lengths as the corresponding
propensity_scores.treated_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp. Should have the same lengths as the corresponding
propensity_scores.estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – What kind of estimator to use. Defaults to “SIPW”.
control_estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – Estimator class for the control arm. Defaults to
estimator_class.treated_estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – Estimator class for the treated arm. Defaults to
estimator_class.control_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the control group. See Notes.
treated_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the treated group. See Notes.
sampling_estimand_class (str, optional) – One of “PopulationMean”, “NonRespondentMean”, or “SampleMean”. Population for which to estimate the average treatment effect. Used only when sampling propensity scores are specified. Defaults to “PopulationMean” in that case. See Notes.
control_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes.treated_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes.control_kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.treated_kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.
Notes
Weighting estimators for the average treatment effect tend to look like:
ÂTE = Σ_{i∈T} wᵢyᵢ/Σ_{i∈T} wᵢ − Σ_{i∈C} wᵢyᵢ/Σ_{i∈C} wᵢ,where sums run over treated (T) and control (C) units, wᵢ = 1/πᵢ for the treated group, and 1/(1 − πᵢ) for the control group, and πᵢ is the propensity score. This is really just the difference between two
MeanEstimatorobjects, which makes calculations (including sensitivity analysis) straightforward.When the units in the study are sampled from a population, and the sample is not a simple random sample, we may wish to estimate treatment effects in the population, which involves elements of both observational causal inference and survey non-response. If sampling propensity scores are available, in additional to treatment assignment propensity scores, we can adjust for both non-response bias and treatment selection bias.
Sometimes we are interested in a treatment effect in a subpopulation that is identifiable only in the sample. For example, people may self-identify as belonging to that population in the sample. We can estimate the population mean among the sub-population as a ratio of two
MeanEstimatorobjects as follows. Let tᵢ be 1 if person i belongs to the sub-population, and 0 otherwise. We observe tᵢ only for respondents. Let yᵢ be the metric of interest. Then the average value of the metric among the sub-population is (sums run over i = 1, …, N):Σᵢ tᵢyᵢ/Σᵢ tᵢ = (1/N) Σᵢ tᵢyᵢ/(1/N) Σᵢ tᵢ,
which is the ratio of the population means of tᵢ × yᵢ and tᵢ. Inference (including sensitivity analysis) for such ratios is provided by
RatioEstimator.We may wish to estimate the impact of a treatment on an outcome in a subpopulation identifiable only in the sample. Let (y0ᵢ, y1ᵢ) be potential outcomes, and assume subpopulation membership is not influenced by treatment, so that tᵢ does not have associated potential outcomes. The quantity of interest is (sums run over i = 1, …, N):
Σᵢ tᵢ(y1ᵢ − y0ᵢ)/Σᵢ tᵢ = (1/N) Σᵢ tᵢy1ᵢ/(1/N) Σᵢ tᵢ − (1/N) Σᵢ tᵢy0ᵢ/(1/N) Σᵢ tᵢ.
By specifying tᵢ × yᵢ as the
control_outcomesandtreated_outcomes(the numerator), and tᵢ as thecontrol_denominator_outcomesandtreated_denominator_outcomes, inference (including sensitivity analysis) for this use case is supported.
- class pyrake.estimation.treatment_effects.ATTEstimator(control_propensity_scores, control_outcomes, treated_outcomes, estimator_class='SIPW', control_estimator_class=None, treated_estimator_class=None, control_sampling_propensity_scores=None, treated_sampling_propensity_scores=None, sampling_estimand_class='PopulationMean', control_denominator_outcomes=None, treated_denominator_outcomes=None, control_kwargs=None, treated_kwargs=None, **kwargs)[source]#
Bases:
TreatmentEffectEstimatorEstimator for the average effect of treatment on the treated (ATT).
- Parameters:
control_propensity_scores (list_like) – Propensity scores for control group.
control_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp. Should have the same lengths as the corresponding
propensity_scores.treated_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp. Should have the same lengths as the corresponding
propensity_scores.estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – What kind of estimator to use. Defaults to “SIPW”.
control_estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – Estimator class for the control arm. Defaults to
estimator_class.treated_estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – Estimator class for the treated arm. Defaults to
estimator_class.control_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the control group. See Notes.
treated_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the treated group. See Notes.
sampling_estimand_class (str, optional) – One of “PopulationMean”, “NonRespondentMean”, or “SampleMean”. Population for which to estimate the average treatment effect. Used only when sampling propensity scores are specified. Defaults to “PopulationMean” in that case. See Notes.
control_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes inATEEstimatorfor details.treated_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes inATEEstimatorfor details.control_kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.treated_kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.
Notes
Weighting estimators for the average treatment effect tend to look like:
ÂTT = Σ_{i∈T} yᵢ/nT − Σ_{i∈C} wᵢyᵢ/Σ_{i∈C} wᵢ,where sums run over treated (T) and control (C) units, nT is the number of treated units, wᵢ = πᵢ/(1 − πᵢ), and πᵢ is the propensity score. This is really just the difference between two
MeanEstimatorobjects, which makes calculations (including sensitivity analysis) straightforward.
- class pyrake.estimation.treatment_effects.ATCEstimator(control_outcomes, treated_propensity_scores, treated_outcomes, estimator_class='SIPW', control_estimator_class=None, treated_estimator_class=None, control_sampling_propensity_scores=None, treated_sampling_propensity_scores=None, sampling_estimand_class='PopulationMean', control_denominator_outcomes=None, treated_denominator_outcomes=None, control_kwargs=None, treated_kwargs=None, **kwargs)[source]#
Bases:
TreatmentEffectEstimatorEstimator for the average effect of treatment on the control units (ATC).
- Parameters:
treated_propensity_scores (list_like) – Propensity scores for the treatment group.
control_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp. Should have the same lengths as the corresponding
propensity_scores.treated_outcomes (list_like) – Outcomes or responses for control and treatment groups, resp. Should have the same lengths as the corresponding
propensity_scores.estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – What kind of estimator to use. Defaults to “SIPW”.
control_estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – Estimator class for the control arm. Defaults to
estimator_class.treated_estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – Estimator class for the treated arm. Defaults to
estimator_class.control_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the control group. See Notes.
treated_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the treated group. See Notes.
sampling_estimand_class (str, optional) – One of “PopulationMean”, “NonRespondentMean”, or “SampleMean”. Population for which to estimate the average treatment effect. Used only when sampling propensity scores are specified. Defaults to “PopulationMean” in that case. See Notes.
control_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes inATEEstimatorfor details.treated_denominator_outcomes (list_like, optional) – If specified, the metric of interest is considered a ratio (with
control_outcomesandtreated_outcomestreated as the numerators), and interest is in the effect of treatment on that ratio. See Notes inATEEstimatorfor details.control_kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.treated_kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.kwargs (dict_like) – Extra kwargs to pass to the estimators.
kwargsare passed to both estimators, whilecontrol_kwargsis only passed to the control estimator andtreated_kwargsis only passed to the treated estimator.
Notes
Weighting estimators for the average treatment effect tend to look like:
ÂTC = Σ_{i∈T} wᵢyᵢ/Σ_{i∈T} wᵢ − Σ_{i∈C} yᵢ/nC,where sums run over treated (T) and control (C) units, nC is the number of control units, wᵢ = (1 − πᵢ)/πᵢ, and πᵢ is the propensity score. This is really just the difference between two
MeanEstimatorobjects, which makes calculations (including sensitivity analysis) straightforward.
- class pyrake.estimation.treatment_effects.TreatmentEffectRatioEstimator(control_propensity_scores, treated_propensity_scores, numerator_control_outcomes, numerator_treated_outcomes, denominator_control_outcomes, denominator_treated_outcomes, mean_estimator_class='SIPW', treatment_effect_estimator_class='ATE', control_sampling_propensity_scores=None, treated_sampling_propensity_scores=None, sampling_estimand_class='PopulationMean', numerator_control_kwargs=None, numerator_treated_kwargs=None, denominator_control_kwargs=None, denominator_treated_kwargs=None)[source]#
Bases:
WeightingEstimatorEstimate the ratio of two treatment effects in some population.
- Parameters:
control_propensity_scores (list_like) – Propensity scores for control and treatment groups, respectively.
treated_propensity_scores (list_like) – Propensity scores for control and treatment groups, respectively.
numerator_control_outcomes (list_like) – Numerator outcomes for control and treated groups.
numerator_treated_outcomes (list_like) – Numerator outcomes for control and treated groups.
denominator_control_outcomes (list_like) – Denominator outcomes for control and treated groups.
denominator_treated_outcomes (list_like) – Denominator outcomes for control and treated groups.
mean_estimator_class (["IPW", "AIPW", "SIPW", "SAIPW"], optional) – Estimator class to use for all sub-estimators. Defaults to “SIPW”.
treatment_effect_estimator_class ([SimpleDifference, ATE, ATT, ATC], optional) – Estimator class for treatment effects. Defaults to “ATE”.
control_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the control group. See Notes.
treated_sampling_propensity_scores (list_like, optional) – Propensity scores for the sampling mechanism for the treated group. See Notes.
sampling_estimand_class (str, optional) – One of “PopulationMean”, “NonRespondentMean”, or “SampleMean”. Population for which to estimate the average treatment effect. Used only when sampling propensity scores are specified. Defaults to “PopulationMean” in that case. See Notes.
numerator_control_kwargs (dict, optional) – Extra kwargs to pass to the numerator control and treated estimators.
numerator_treated_kwargs (dict, optional) – Extra kwargs to pass to the numerator control and treated estimators.
denominator_control_kwargs (dict, optional) – Extra kwargs to pass to the denominator control and treated estimators.
denominator_treated_kwargs (dict, optional) – Extra kwargs to pass to the denominator control and treated estimators.
Notes
Sensitivity analysis and expanded confidence intervals are not implemented because the ratio of differences of linear-fractional problems is not quasilinear and cannot be transformed to a linear program easily.
- point_estimate()[source]#
Calculate a point estimate.
- Returns:
estimate – Ratio of the numerator and denominator treatment-effect estimates.
- Return type:
- variance()[source]#
Calculate the variance of the ratio estimator using the delta method.
- Returns:
variance – Estimated sampling variance of the ratio estimate.
- Return type:
- Raises:
ValueError – If any sub-estimator is itself a
RatioEstimator.
- sensitivity_analysis(gamma=6.0, outcome_proxies=None, proxy_mean=None, alpha=0.1)[source]#
Raise NotImplementedError (sensitivity analysis is unsupported).
- Raises:
NotImplementedError – Always raised; the ratio of differences of linear-fractional problems is not quasilinear.
- resample(B, seed=None)[source]#
Raise NotImplementedError (resampling is unsupported).
- Raises:
NotImplementedError – Always raised; resampling is not implemented for
TreatmentEffectRatioEstimator.
- expanded_confidence_interval(alpha=0.1, gamma=6.0, alternative='two-sided', bootstrap=True, B=1000, seed=None)[source]#
Raise NotImplementedError (expanded confidence intervals unsupported).
- Raises:
NotImplementedError – Always raised; expanded confidence intervals are not implemented for
TreatmentEffectRatioEstimator.