class_docstr: Class to perform sensitivity analysis
  See: https://carloscinelli.com/files/Cinelli%20and%20Hazlett%20(2020)%20-%20Making%20Sense%20of%20Sensitivity.pdf
  
  :param estimator: linear estimator of the causal model
  :param data: Pandas dataframe
  :param treatment_name: name of treatment
   :param percent_change_estimate: It is the percentage of reduction of treatment estimate that could alter the results (default = 1)
                                      if percent_change_estimate = 1, the robustness value describes the strength of association of confounders with treatment and outcome in order to reduce the estimate by 100% i.e bring it down to 0.
  :param null_hypothesis_effect: assumed effect under the null hypothesis
  :param confounder_increases_estimate: True implies that confounder increases the absolute value of estimate and vice versa. (Default = True)
  :param benchmark_common_causes: names of variables for bounding strength of confounders
  :param significance_level: confidence interval for statistical inference(default = 0.05)
  :param frac_strength_treatment: strength of association between unobserved confounder and treatment compared to benchmark covariate
  :param frac_strength_outcome: strength of association between unobserved confounder and outcome compared to benchmark covariate
  :param common_causes_order: The order of column names in OLS regression data
class_docstr_tok: ["Class","to","perform","sensitivity","analysis","See",":","https",":","\/\/carloscinelli.com\/files\/Cinelli","%","20and","%","20Hazlett","%","20","(","2020",")","%","20-","%","20Making","%","20Sense","%","20of","%","20Sensitivity.pdf",":","param","estimator",":","linear","estimator","of","the","causal","model",":","param","data",":","Pandas","dataframe",":","param","treatment_name",":","name","of","treatment",":","param","percent_change_estimate",":","It","is","the","percentage","of","reduction","of","treatment","estimate","that","could","alter","the","results","(","default","=","1",")","if","percent_change_estimate","=","1",",","the","robustness","value","describes","the","strength","of","association","of","confounders","with","treatment","and","outcome","in","order","to","reduce","the","estimate","by","100","%","i.e","bring","it","down","to","0.",":","param","null_hypothesis_effect",":","assumed","effect","under","the","null","hypothesis",":","param","confounder_increases_estimate",":","True","implies","that","confounder","increases","the","absolute","value","of","estimate","and","vice","versa",".","(","Default","=","True",")",":","param","benchmark_common_causes",":","names","of","variables","for","bounding","strength","of","confounders",":","param","significance_level",":","confidence","interval","for","statistical","inference","(","default","=","0.05",")",":","param","frac_strength_treatment",":","strength","of","association","between","unobserved","confounder","and","treatment","compared","to","benchmark","covariate",":","param","frac_strength_outcome",":","strength","of","association","between","unobserved","confounder","and","outcome","compared","to","benchmark","covariate",":","param","common_causes_order",":","The","order","of","column","names","in","OLS","regression","data"]
code: def __init__(
      self,
      estimator=None,
      data=None,
      treatment_name=None,
      percent_change_estimate=1.0,
      significance_level=0.05,
      confounder_increases_estimate=True,
      benchmark_common_causes=None,
      null_hypothesis_effect=0,
      frac_strength_treatment=None,
      frac_strength_outcome=None,
      common_causes_order=None,
  ):
      self.data = data
      self.treatment_name = []
      # original_treatment_name: : stores original variable names for labelling
      self.original_treatment_name = treatment_name
      for t in range(len(treatment_name)):
          self.treatment_name.append("x" + str(t + 1))
  
      self.percent_change_estimate = percent_change_estimate
      self.significance_level = significance_level
      self.confounder_increases_estimate = confounder_increases_estimate
      self.estimator = estimator
      self.estimator_model = estimator.model
      self.null_hypothesis_effect = null_hypothesis_effect
  
      # common_causes_map : maps the original variable names to variable names in OLS regression
      self.common_causes_map = {}
      for i in range(len(common_causes_order)):
          self.common_causes_map[common_causes_order[i]] = "x" + str(
              len(self.treatment_name) + i + 1
          )
  
      # benchmark_common_causes: stores variable names in terms of regression model variables
      benchmark_common_causes = parse_state(benchmark_common_causes)
      self.benchmark_common_causes = []
      # original_benchmark_covariates: stores original variable names for labelling
      self.original_benchmark_covariates = benchmark_common_causes
      for i in range(len(benchmark_common_causes)):
          self.benchmark_common_causes.append(
              self.common_causes_map[benchmark_common_causes[i]]
          )
  
      if type(frac_strength_treatment) in [int, list, float]:
          self.frac_strength_treatment = np.array(
              frac_strength_treatment
          )
      if type(frac_strength_outcome) in [int, list, float]:
          self.frac_strength_outcome = np.array(frac_strength_outcome)
  
      # estimate: estimate of regression
      self.estimate = None
      # degree_of_freedom: degree of freedom of error in regression
      self.degree_of_freedom = None
      # standard_error: standard error in regression
      self.standard_error = None
      # t_stats: Treatment coefficient t-value - measures how many standard errors the estimate is away from zero.
      self.t_stats = None
      # partial_f2: value to determine if a regression model and a nested version of it have a statistically significant difference between them
      self.partial_f2 = None
      # r2tu_w: partial R^2  of unobserved confounder "u" with treatment "t", after conditioning on observed covariates "w"
      self.r2tu_w = None
      # r2yu_tw: partial R^2  of unobserved confounder "u" with outcome "y", after conditioning on observed covariates "w" and treatment "t"
      self.r2yu_tw = None
      # r2twj_w: partial R^2 of observed covariate wj with treatment "t", after conditioning on observed covariates "w" excluding wj
      self.r2twj_w = None
      # r2ywj_tw:  partial R^2 of observed covariate wj with outcome "y", after conditioning on observed covariates "w" (excluding wj) and treatment "t"
      self.r2ywj_tw = None
      # benchmarking_results: dataframe containing information about bounds and bias adjusted terms
      self.benchmarking_results = None
      # stats: dictionary containing information like robustness value, partial R^2, estimate, standard error , degree of freedom, partial f^2, t-statistic
      self.stats = None
      self.logger = logging.getLogger(__name__)
  
file_path: dowhy/dowhy/causal_refuters/linear_sensitivity_analyzer.py
imports: import logging
  import matplotlib.pyplot
  import numpy
  import pandas
  import statsmodels.api
  from scipy.stats import t
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 1 to create a new LinearSensitivityAnalyzer object  with example: obj = LinearSensitivityAnalyzer(estimator, data, treatment_name, percent_change_estimate, significance_level, confounder_increases_estimate, benchmark_common_causes, null_hypothesis_effect, frac_strength_treatment, frac_strength_outcome, common_causes_order)