riantr/moonbit_dowhy/refuters does not have a README file

    BiasAdjustedTerms

    pub struct BiasAdjustedTerms {
    estimates : Array[Double]
    standard_errors : Array[Double]
    t_statistics : Array[Double]
    lower_bounds : Array[Double]
    upper_bounds : Array[Double]
    }

    The bias adjusted terms of a set of partial R2.

    BiasAdjustedTerms::estimates

    fn BiasAdjustedTerms::estimates(self : BiasAdjustedTerms) -> Array[Double]

    The bias adjusted estimate of every pair of partial R2.

    BiasAdjustedTerms::lower_bounds

    fn BiasAdjustedTerms::lower_bounds(self : BiasAdjustedTerms) -> Array[Double]

    The lower bound of the bias adjusted estimate.

    BiasAdjustedTerms::standard_errors

    fn BiasAdjustedTerms::standard_errors(self : BiasAdjustedTerms) -> Array[Double]

    The standard error of the bias adjusted estimate.

    BiasAdjustedTerms::t_statistics

    fn BiasAdjustedTerms::t_statistics(self : BiasAdjustedTerms) -> Array[Double]

    The t statistic of the bias adjusted estimate.

    BiasAdjustedTerms::upper_bounds

    fn BiasAdjustedTerms::upper_bounds(self : BiasAdjustedTerms) -> Array[Double]

    The upper bound of the bias adjusted estimate.

    CausalRefutation

    pub struct CausalRefutation {
    estimated_effect : Double
    new_effect : Double
    new_effect_lower : Double
    new_effect_upper : Double
    refutation_type : String
    p_value : Double
    is_significant : Bool
    }

    The result of one refutation.

    CausalRefutation::estimated_effect

    fn CausalRefutation::estimated_effect(self : CausalRefutation) -> Double

    The original estimate.

    CausalRefutation::is_significant

    fn CausalRefutation::is_significant(self : CausalRefutation) -> Bool

    Whether the refutation is statistically significant.

    CausalRefutation::new

    fn CausalRefutation::new(estimated_effect : Double, new_effect : Double, refutation_type : String) -> CausalRefutation

    A refutation without a significance test.

    CausalRefutation::new_effect

    fn CausalRefutation::new_effect(self : CausalRefutation) -> Double

    The estimate after the refutation.

    CausalRefutation::new_effect_lower

    fn CausalRefutation::new_effect_lower(self : CausalRefutation) -> Double

    The lower bound of the refuted estimates.

    CausalRefutation::new_effect_upper

    fn CausalRefutation::new_effect_upper(self : CausalRefutation) -> Double

    The upper bound of the refuted estimates.

    CausalRefutation::p_value

    fn CausalRefutation::p_value(self : CausalRefutation) -> Double

    The p-value of the significance test.

    CausalRefutation::refutation_type

    fn CausalRefutation::refutation_type(self : CausalRefutation) -> String

    The name of the refutation.

    CausalRefutation::to_string

    fn CausalRefutation::to_string(self : CausalRefutation) -> String

    A human readable summary of the refutation.

    ConfoundersEffectOnT

    pub enum ConfoundersEffectOnT {
    BinaryFlip
    Linear
    }

    The kind of effect the simulated confounder has on the treatment.

    ConfoundersEffectOnT::binary_flip

    A flipped value of the treatment.

    ConfoundersEffectOnT::linear

    A linear effect on the treatment.

    ConfoundersEffectOnY

    pub enum ConfoundersEffectOnY {
    BinaryFlip
    Linear
    }

    The kind of effect the simulated confounder has on the outcome.

    ConfoundersEffectOnY::binary_flip

    A flipped value of the outcome.

    ConfoundersEffectOnY::linear

    A linear effect on the outcome.

    EValueSensitivityAnalyzer

    pub struct EValueSensitivityAnalyzer {
    estimate : Double
    standard_error : Double
    treatment_delta : Double
    outcome_sd : Double
    stats : EValueStats
    benchmarking : Array[ObservedCovariateEValue]
    }

    The E-value analysis of an estimate.

    This is the port of dowhy.causal_refuters.evalue_sensitivity_analyzer.EValueSensitivityAnalyzer. It reports the E-value of the estimate of the data, the E-value of the limit of its interval that is closer to the null, and the Observed Covariate E-value of every measured confounder.

    The estimate of a linear regression is a difference of means, and the analysis turns it into a standardised difference with the standard deviation of the outcome before it converts it to the risk ratio scale. The estimate of a generalised linear model is on the scale of the link of its family: a binomial model with the logit link gives an odds ratio and a Poisson model with the log link gives a rate ratio.

    EValueSensitivityAnalyzer::benchmarking

    The Observed Covariate E-value of every measured confounder.

    EValueSensitivityAnalyzer::estimate

    The effect of the treatment.

    EValueSensitivityAnalyzer::outcome_sd

    fn EValueSensitivityAnalyzer::outcome_sd(self : EValueSensitivityAnalyzer) -> Double

    The standard deviation of the outcome.

    EValueSensitivityAnalyzer::standard_error

    fn EValueSensitivityAnalyzer::standard_error(self : EValueSensitivityAnalyzer) -> Double

    The standard error of the effect.

    EValueSensitivityAnalyzer::stats

    The statistics of the analysis.

    EValueSensitivityAnalyzer::treatment_delta

    fn EValueSensitivityAnalyzer::treatment_delta(self : EValueSensitivityAnalyzer) -> Double

    The contrast of the treatment.

    EValueStats

    pub struct EValueStats {
    converted_estimate : Double
    converted_lower_ci : Double?
    converted_upper_ci : Double?
    evalue_estimate : Double
    evalue_lower_ci : Double?
    evalue_upper_ci : Double?
    }

    The E-value of an estimate and of its confidence limits.

    This is the port of the dictionary the upstream returns from EValueSensitivityAnalyzer._evalue_RR. The E-value of the limit of the interval that is closer to the null is the one that is reported, so the other one is absent.

    EValueStats::converted_estimate

    fn EValueStats::converted_estimate(self : EValueStats) -> Double

    The estimate, converted to the risk ratio scale.

    EValueStats::converted_lower_ci

    fn EValueStats::converted_lower_ci(self : EValueStats) -> Double?

    The lower limit of the interval, converted to the risk ratio scale.

    EValueStats::converted_upper_ci

    fn EValueStats::converted_upper_ci(self : EValueStats) -> Double?

    The upper limit of the interval, converted to the risk ratio scale.

    EValueStats::evalue_estimate

    fn EValueStats::evalue_estimate(self : EValueStats) -> Double

    The E-value of the estimate.

    EValueStats::evalue_lower_ci

    fn EValueStats::evalue_lower_ci(self : EValueStats) -> Double?

    The E-value of the limit of the interval that is closer to the null.

    EValueStats::evalue_upper_ci

    fn EValueStats::evalue_upper_ci(self : EValueStats) -> Double?

    The E-value of the limit of the interval that is closer to the null.

    LinearSensitivityAnalyzer

    pub struct LinearSensitivityAnalyzer {
    estimate : Double
    standard_error : Double
    degree_of_freedom : Int
    t_statistic : Double
    r2yt_w : Double
    partial_f2 : Double
    robustness_value : Double
    robustness_value_alpha : Double
    confounder_increases_estimate : Bool
    null_hypothesis_effect : Double
    significance_level : Double
    r2tu_w : Array[Double]
    r2yu_tw : Array[Double]
    bias_adjusted_estimate : Array[Double]
    bias_adjusted_se : Array[Double]
    bias_adjusted_t : Array[Double]
    bias_adjusted_lower_ci : Array[Double]
    bias_adjusted_upper_ci : Array[Double]
    }

    The result of the linear sensitivity analysis.

    LinearSensitivityAnalyzer::bias_adjusted_estimate

    fn LinearSensitivityAnalyzer::bias_adjusted_estimate(self : LinearSensitivityAnalyzer) -> Array[Double]

    The bias adjusted estimate.

    LinearSensitivityAnalyzer::bias_adjusted_lower_ci

    fn LinearSensitivityAnalyzer::bias_adjusted_lower_ci(self : LinearSensitivityAnalyzer) -> Array[Double]

    The lower bound of the bias adjusted estimate.

    LinearSensitivityAnalyzer::bias_adjusted_se

    fn LinearSensitivityAnalyzer::bias_adjusted_se(self : LinearSensitivityAnalyzer) -> Array[Double]

    The standard error of the bias adjusted estimate.

    LinearSensitivityAnalyzer::bias_adjusted_t

    fn LinearSensitivityAnalyzer::bias_adjusted_t(self : LinearSensitivityAnalyzer) -> Array[Double]

    The t statistic of the bias adjusted estimate.

    LinearSensitivityAnalyzer::bias_adjusted_upper_ci

    fn LinearSensitivityAnalyzer::bias_adjusted_upper_ci(self : LinearSensitivityAnalyzer) -> Array[Double]

    The upper bound of the bias adjusted estimate.

    LinearSensitivityAnalyzer::confounder_increases_estimate

    fn LinearSensitivityAnalyzer::confounder_increases_estimate(self : LinearSensitivityAnalyzer) -> Bool

    Whether the confounder moves the estimate away from zero.

    LinearSensitivityAnalyzer::degree_of_freedom

    fn LinearSensitivityAnalyzer::degree_of_freedom(self : LinearSensitivityAnalyzer) -> Int

    The degrees of freedom of the outcome regression.

    LinearSensitivityAnalyzer::estimate

    The estimate of the data.

    LinearSensitivityAnalyzer::null_hypothesis_effect

    fn LinearSensitivityAnalyzer::null_hypothesis_effect(self : LinearSensitivityAnalyzer) -> Double

    The effect under the null hypothesis of the analysis.

    LinearSensitivityAnalyzer::partial_f2

    fn LinearSensitivityAnalyzer::partial_f2(self : LinearSensitivityAnalyzer) -> Double

    The partial F2 of the estimate.

    LinearSensitivityAnalyzer::r2tu_w

    The partial R2 of the confounder with the treatment given the common causes.

    LinearSensitivityAnalyzer::r2yt_w

    The partial R2 of the treatment with the outcome given the common causes.

    LinearSensitivityAnalyzer::r2yu_tw

    The partial R2 of the confounder with the outcome given the treatment and the common causes.

    LinearSensitivityAnalyzer::robustness_value

    fn LinearSensitivityAnalyzer::robustness_value(self : LinearSensitivityAnalyzer) -> Double

    The robustness value of the estimate.

    LinearSensitivityAnalyzer::robustness_value_alpha

    fn LinearSensitivityAnalyzer::robustness_value_alpha(self : LinearSensitivityAnalyzer) -> Double

    The robustness value at the significance level of the analysis.

    LinearSensitivityAnalyzer::significance_level

    fn LinearSensitivityAnalyzer::significance_level(self : LinearSensitivityAnalyzer) -> Double

    The level of the interval of the bias adjusted estimate.

    LinearSensitivityAnalyzer::standard_error

    fn LinearSensitivityAnalyzer::standard_error(self : LinearSensitivityAnalyzer) -> Double

    The standard error of the estimate.

    LinearSensitivityAnalyzer::t_statistic

    fn LinearSensitivityAnalyzer::t_statistic(self : LinearSensitivityAnalyzer) -> Double

    The t statistic of the estimate against the null hypothesis of the analysis.

    ObservedCovariateEValue

    pub struct ObservedCovariateEValue {
    covariate : String
    converted_estimate : Double
    converted_lower_ci : Double?
    converted_upper_ci : Double?
    evalue : Double
    }

    The Observed Covariate E-value of a measured confounder.

    This is the port of the row of the benchmarking_results of the upstream. It reports the estimate that was computed without the confounder and the strength of the association that the confounder would need to move the limit of the interval of the original estimate to the limit of the interval of the estimate without it.

    ObservedCovariateEValue::converted_estimate

    fn ObservedCovariateEValue::converted_estimate(self : ObservedCovariateEValue) -> Double

    The estimate without the confounder, converted to the risk ratio scale.

    ObservedCovariateEValue::covariate

    fn ObservedCovariateEValue::covariate(self : ObservedCovariateEValue) -> String

    The name of the confounder.

    ObservedCovariateEValue::evalue

    The E-value of the confounder.

    PlaceboType

    pub enum PlaceboType {
    RandomData
    Permute
    }

    The kind of placebo the placebo treatment refuter builds.

    PlaceboType::permute

    fn PlaceboType::permute() -> PlaceboType

    The permuted placebo: the rows of the treatment are permuted.

    PlaceboType::random_data

    fn PlaceboType::random_data() -> PlaceboType

    The random data placebo: the treatment is replaced by a random variable.

    RequiredVariables

    pub enum RequiredVariables {
    All
    None
    Count(Int)
    Named(Array[String])
    Others(Array[String])
    }

    The variables the bootstrap refuter perturbs.

    This is the port of the required_variables argument of the upstream: a boolean asks for every variable of interest or for none of them, an integer asks for that many of them and a list names them. The upstream takes the three of them in one argument and raises an error when a list selects and deselects at the same time; the enumeration of the port cannot hold such a list.

    RequiredVariables::all

    Every variable of interest.

    RequiredVariables::count

    fn RequiredVariables::count(count : Int) -> RequiredVariables

    That many variables of interest, chosen at random.

    RequiredVariables::named

    fn RequiredVariables::named(names : Array[String]) -> RequiredVariables

    The named variables of interest.

    RequiredVariables::none

    No variable at all.

    RequiredVariables::others

    fn RequiredVariables::others(names : Array[String]) -> RequiredVariables

    Every variable of interest but the named ones.

    SignificanceTestType

    pub enum SignificanceTestType {
    Auto
    Bootstrap
    Normal
    }

    The kind of test the significance test of a refutation uses.

    SignificanceTestType::auto

    The automatic kind of test.

    SignificanceTestType::bootstrap

    The two sided percentile test of the bootstrap.

    SignificanceTestType::normal

    The test of the normal distribution.

    Transformation

    pub enum Transformation {
    Zero
    Noise(Double)
    Permute(Double)
    LinearRegression
    NearestNeighbour(Int)
    Estimate((
    DataFrame
    , Array[Double],
    DataFrame
    ) -> (Array[Double], Array[Double]))
    }

    A transformation of the outcome of the dummy outcome refuter.

    Transformation::estimate

    A transformation that predicts the outcome with the given model.

    Transformation::linear_regression

    fn Transformation::linear_regression() -> Transformation

    A transformation that predicts the outcome with a linear regression.

    Transformation::nearest_neighbour

    fn Transformation::nearest_neighbour(k : Int) -> Transformation

    A transformation that predicts the outcome with the k nearest neighbours.

    Transformation::noise

    fn Transformation::noise(std_dev : Double) -> Transformation

    A transformation that adds a white noise of the given standard deviation.

    Transformation::permute

    fn Transformation::permute(fraction : Double) -> Transformation

    A transformation that permutes the given fraction of the rows.

    Transformation::zero

    A transformation that replaces every value by zero.

    bootstrap_significance

    fn bootstrap_significance(estimate : Double, simulations : Array[Double]) -> Double

    The two sided percentile p-value of the bootstrap test.

    This is the port of perform_bootstrap_test of dowhy.causal_refuter: the p-value is two times the smaller of the share of the simulations that are above the estimate and the share of the ones that are below it, where a simulation that is equal to the estimate counts as a half.

    A refuter that ran no simulation has no distribution to test the estimate against, so the p-value is one. The upstream computes the mean and the standard deviation of the simulations with numpy, which returns nan for an empty array, so its p-value is nan in that case.

    compute_bias_adjusted

    fn compute_bias_adjusted(analyzer : LinearSensitivityAnalyzer, r2tu_w : Array[Double], r2yu_tw : Array[Double]) -> BiasAdjustedTerms

    The bias adjusted terms of two sets of partial R2.

    This is the port of compute_bias_adjusted of the upstream, which the upstream test calls with two sets of its own.

    dummy_outcome_default_transformations

    fn dummy_outcome_default_transformations() -> Array[Transformation]

    The transformation list of the upstream when the caller gives none.

    evalue_md

    fn evalue_md(estimate : Double, standard_error : Double?, no_effect_baseline? : Double) -> EValueStats

    The E-value of a standardised difference and of the limits of its interval.

    This is the port of EValueSensitivityAnalyzer._evalue_MD. The limits of the interval are the ones of the table 2 of the paper of Ding and VanderWeele, and the standardised difference is converted to an approximate risk ratio with exp(0.91 * difference).

    evalue_ols

    fn evalue_ols(estimate : Double, standard_error : Double, outcome_sd : Double, treatment_delta : Double, no_effect_baseline? : Double) -> EValueStats

    The E-value of the coefficient of a linear regression.

    This is the port of EValueSensitivityAnalyzer._evalue_OLS. The coefficient and its standard error are turned into a standardised difference with the standard deviation of the outcome, and the contrast of the treatment scales the coefficient but not the standard error, because the estimator of the upstream already scaled it.

    evalue_or

    fn evalue_or(estimate : Double, lower : Double?, upper : Double?, rare : Bool, no_effect_baseline? : Double) -> EValueStats

    The E-value of an odds ratio and of the limits of its interval.

    This is the port of EValueSensitivityAnalyzer._evalue_OR. An outcome that is rare keeps its odds ratio, and an outcome that is not rare is converted to an approximate risk ratio with its square root.

    evalue_rr

    fn evalue_rr(estimate : Double, lower : Double?, upper : Double?, no_effect_baseline? : Double) -> EValueStats

    The E-value of a risk ratio and of the limits of its interval.

    This is the port of EValueSensitivityAnalyzer._evalue_RR. The E-value of the limit of the interval that is closer to the null is the one that is reported, and both of them are one when the interval of the estimate crosses the null, because the interval is then already tipped.

    The baseline is the risk ratio of no effect, which is one for a risk ratio. A baseline that is not one asks for the strength of the confounding that moves the estimate to that baseline instead of to the null.

    evalue_sensitivity_analyzer

    fn evalue_sensitivity_analyzer(estimator :
    CausalEstimator
    , data :
    DataFrame
    , outcome_name : String, target_units? : String) -> EValueSensitivityAnalyzer

    The E-value analysis of the estimate of an estimator.

    This is the port of the check_sensitivity of the upstream and of its benchmark.

    The estimate of the estimator is the effect of the treatment, and its standard error is the standard error of that effect, so the two carry the contrast of the treatment already. The analysis of the upstream scales the coefficient of the treatment with the contrast and leaves the standard error alone, because the standard error of its estimator carries the contrast as well.

    The standard deviation of the outcome is the one of the rows of the data, with the convention of NumPy, which is the one the upstream uses.

    The upstream refuses an estimator with effect modifiers, and the port does the same.

    infer_default_kappa_t

    fn infer_default_kappa_t(data :
    DataFrame
    , estimand :
    IdentifiedEstimand
    , treatment_name : String, effect_on_t : ConfoundersEffectOnT, frac_strength_treatment : Double, len_kappa_t : Int) -> Array[Double]

    The default strength of the confounder on the treatment.

    This is the port of _infer_default_kappa_t of the upstream.

    infer_default_kappa_y

    fn infer_default_kappa_y(data :
    DataFrame
    , estimand :
    IdentifiedEstimand
    , outcome_name : String, effect_on_y : ConfoundersEffectOnY, frac_strength_outcome : Double, len_kappa_y : Int) -> Array[Double]

    The default strength of the confounder on the outcome.

    This is the port of _infer_default_kappa_y of the upstream.

    linear_sensitivity_analyzer

    fn linear_sensitivity_analyzer(estimator :
    CausalEstimator
    , data :
    DataFrame
    , treatment_name : String, benchmark_common_causes : Array[String], frac_strength_treatment : Array[Double], frac_strength_outcome : Array[Double]?, percent_change_estimate : Double, significance_level : Double, confounder_increases_estimate? : Bool) -> LinearSensitivityAnalyzer

    The linear sensitivity analysis of the estimate.

    benchmark_common_causes names the common causes whose strength bounds the strength of the confounder, frac_strength_treatment holds the fractions of that strength to analyse, one per row of the results, and frac_strength_outcome the fractions on the outcome. When the outcome's fractions are not given, the treatment's ones are used, which is what the upstream does when the caller does not give a strength for the outcome.

    percent_change_estimate is the share of the estimate the confounder has to remove to change the conclusion, significance_level the level of the interval of the bias adjusted estimate, and confounder_increases_estimate whether the confounder moves the estimate away from zero or toward it.

    The confounder moves the estimate away from zero unless the caller says otherwise, because the upstream builds its analyzer without the flag of its refuter: sensitivity_linear_partial_r2 never passes it, so the analyzer keeps its own default of True.

    normal_significance

    fn normal_significance(estimate : Double, simulations : Array[Double]) -> Double

    The p-value of the test of the normal distribution.

    This is the port of perform_normal_distribution_test of dowhy.causal_refuter: the estimate is tested against the mean and the standard deviation of the simulations with the normal distribution.

    observed_covariate_e_value

    fn observed_covariate_e_value(ci : Double, new_ci : Double) -> Double

    The E-value of a measured confounder, the one of McGowan and Greevy.

    This is the port of EValueSensitivityAnalyzer._observed_covariate_e_value. It compares the limit of the interval of the estimate with the limit of the interval of the estimate that was computed without the confounder, and it reports the strength of the association that the confounder would need to move the first limit to the second one.

    refute_add_unobserved_common_cause

    fn refute_add_unobserved_common_cause(estimator :
    CausalEstimator
    , estimand :
    IdentifiedEstimand
    , data :
    DataFrame
    , treatment_name : String, outcome_name : String, kappa_t : Double, kappa_y : Double, treatment_value : Double, control_value : Double, target_units : String, random :
    Random
    , effect_on_t? : ConfoundersEffectOnT, effect_on_y? : ConfoundersEffectOnY) -> CausalRefutation

    The refuter that adds an unobserved common cause.

    kappa_t is the strength of the confounder on the treatment and kappa_y the strength on the outcome. The simulation is the one of the upstream: a single confounder is drawn and a single refutation is reported, so there is no interval to report besides the refuted effect itself.

    refute_bootstrap

    fn refute_bootstrap(estimator :
    CausalEstimator
    , estimand :
    IdentifiedEstimand
    , data :
    DataFrame
    , num_simulations : Int, sample_size_fraction : Double, treatment_value : Double, control_value : Double, target_units : String, random :
    Random
    , required_variables? : RequiredVariables, noise? : Double, probability_of_change? : Double?) -> CausalRefutation

    The bootstrap refuter.

    The data is resampled with replacement and the variables of interest are perturbed with a noise; the effect is re-estimated on every resample and the refutation reports the mean of the resampled estimates and the interval they span.

    The noise of a numeric column has the standard deviation of the given fraction of the standard deviation of the column, the way the upstream perturbs it. A column of zeros and ones is flipped and a discrete column gets another one of its categories, both with the probability of the change, which is the noise unless it is given.

    refute_data_subset

    fn refute_data_subset(estimator :
    CausalEstimator
    , estimand :
    IdentifiedEstimand
    , data :
    DataFrame
    , subset_fraction : Double, num_simulations : Int, treatment_value : Double, control_value : Double, target_units : String, random :
    Random
    ) -> CausalRefutation

    The data subset refuter.

    The effect is re-estimated on random subsets of the data; a robust estimate does not depend on the subset. The subset holds no row twice, the way the upstream samples it.

    refute_dummy_outcome

    fn refute_dummy_outcome(estimator :
    CausalEstimator
    , estimand :
    IdentifiedEstimand
    , data :
    DataFrame
    , outcome_name : String, treatment_name : String, num_simulations : Int, treatment_value : Double, control_value : Double, target_units : String, random :
    Random
    , required_variables? : RequiredVariables, transformations? : Array[Transformation], min_data_point_threshold? : Int, bucket_size_scale_factor? : Double, test_fraction? : Double, true_causal_effect? : (Array[Double]) -> Array[Double]?) -> Array[CausalRefutation]

    The dummy outcome refuter.

    The estimate of the data is refuted by replacing the outcome with a simulated outcome whose causal effect is true_causal_effect, which is zero when the caller gives no other. The refutations come back with one entry per bucket of the treatment, the way the upstream returns its list.

    refute_placebo_treatment

    fn refute_placebo_treatment(estimator :
    CausalEstimator
    , estimand :
    IdentifiedEstimand
    , data :
    DataFrame
    , treatment_name : String, num_simulations : Int, treatment_value : Double, control_value : Double, target_units : String, random :
    Random
    , placebo_type? : PlaceboType) -> CausalRefutation

    The placebo treatment refuter.

    The treatment is replaced by a placebo variable and the effect is estimated again on every simulation; a causal estimate that survives the refutation is not credible.

    The random data placebo builds the placebo the way the upstream does: a continuous treatment becomes a constant zero, a binary treatment becomes a random draw of a Bernoulli variable with the probability of a half, and a categorical treatment becomes a random draw of one of its categories. The permuted placebo takes the rows of the treatment and permutes them.

    The upstream reports the error it raises for the instrumental variable method with the random data placebo; MoonBit cannot catch an error, so the port aborts with the message of the upstream.

    refute_random_common_cause

    fn refute_random_common_cause(estimator :
    CausalEstimator
    , _estimand :
    IdentifiedEstimand
    , data :
    DataFrame
    , num_simulations : Int, treatment_value : Double, control_value : Double, target_units : String, random :
    Random
    ) -> CausalRefutation

    The random common cause refuter.

    A random variable is added to the adjustment set; a robust estimate does not change.

    test_significance

    fn test_significance(estimate : Double, simulations : Array[Double], test_type? : SignificanceTestType, significance_level? : Double) -> (Double, Bool)

    The p-value of the significance test of a refutation and whether the estimate is significant at the given level.

    This is the port of test_significance of dowhy.causal_refuter: the estimate is tested against the distribution of the estimates the refuter produced. The refutations that sever the causal relation test the zero estimate against it, the ones that leave the relation alone test the estimate of the data against it.