class_docstr: Base class for an estimator of causal effect.
  
  Subclasses implement different estimation methods. All estimation methods are in the package "dowhy.causal_estimators"
class_docstr_tok: ["Base","class","for","an","estimator","of","causal","effect",".","Subclasses","implement","different","estimation","methods",".","All","estimation","methods","are","in","the","package","``","dowhy.causal_estimators","''"]
docstr: Test statistical significance of an estimate using the bootstrap method.
  
  :param estimate_value: Obtained estimate's value
  :param num_null_simulations: Number of simulations for the null hypothesis
  :returns: p-value of the statistical significance test.
code: def _test_significance_with_bootstrap(
      self,
      data: pd.DataFrame,
      estimate_value,
      num_null_simulations=None,
  ):
      """Test statistical significance of an estimate using the bootstrap method.
  
      :param estimate_value: Obtained estimate's value
      :param num_null_simulations: Number of simulations for the null hypothesis
      :returns: p-value of the statistical significance test.
      """
      # Use existing params, if new user defined params are not present
      if num_null_simulations is None:
          num_null_simulations = self.num_null_simulations
      do_retest = (
          self._bootstrap_null_estimates is None
          or CausalEstimator.is_bootstrap_parameter_changed(
              self._bootstrap_null_estimates.params, locals()
          )
      )
      if do_retest:
          null_estimates = np.zeros(num_null_simulations)
          new_estimand = copy.deepcopy(self._target_estimand)
          new_estimand.outcome_variable = ["dummy_outcome"]
          for i in range(num_null_simulations):
              new_outcome = np.random.permutation(
                  data[self._target_estimand.outcome_variable]
              )
              new_data = data.assign(dummy_outcome=new_outcome)
              new_estimator = self.get_new_estimator_object(
                  new_estimand,
                  test_significance=False,
                  evaluate_effect_strength=False,
                  confidence_intervals=False,
              )
              new_estimator.fit(
                  data=new_data,
                  effect_modifier_names=self._effect_modifier_names,
              )
  
              new_effect = new_estimator.estimate_effect(
                  new_data,
                  target_units=self._target_units,
              )
              null_estimates[i] = new_effect.value
          self._bootstrap_null_estimates = (
              CausalEstimator.BootstrapEstimates(
                  null_estimates,
                  {
                      "num_null_simulations": num_null_simulations,
                      "sample_size_fraction": 1,
                  },
              )
          )
  
      # Processing the null hypothesis estimates
      sorted_null_estimates = np.sort(
          self._bootstrap_null_estimates.estimates
      )
      self.logger.debug(
          "Null estimates: {0}".format(sorted_null_estimates)
      )
      median_estimate = sorted_null_estimates[
          int(num_null_simulations / 2)
      ]
      # Doing a two-sided test
      if estimate_value > median_estimate:
          # Being conservative with the p-value reported
          estimate_index = np.searchsorted(
              sorted_null_estimates, estimate_value, side="left"
          )
          p_value = 1 - (estimate_index / num_null_simulations)
      if estimate_value <= median_estimate:
          # Being conservative with the p-value reported
          estimate_index = np.searchsorted(
              sorted_null_estimates, estimate_value, side="right"
          )
          p_value = estimate_index / num_null_simulations
      # If the estimate_index is 0, it depends on the number of simulations
      if p_value == 0:
          p_value = (
              0,
              1 / len(sorted_null_estimates),
          )  # a tuple determining the range.
      elif p_value == 1:
          p_value = (1 - 1 / len(sorted_null_estimates), 1)
      signif_dict = {"p_value": p_value}
      return signif_dict
  
imports: import copy
  import logging
  from collections import namedtuple
  from typing import Dict, List, Optional, Union
  import numpy
  import pandas
  import sympy
  from sklearn.utils import resample
  import dowhy.interpreters
  from dowhy.causal_identifier.identified_estimand import IdentifiedEstimand
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 18 for calling the CausalEstimator obj's underlying member method code with example usage: obj._test_significance_with_bootstrap(data, estimate_value, num_null_simulations) and returns: signif_dict