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"]
docstr: Computes the bias adjusted estimate, standard error, t-value,  partial R2, confidence intervals
  
  :param r2tu_w: partial r^2 from regressing unobserved confounder u on treatment t after conditioning on observed covariates w
  :param r2yu_tw: partial r^2 from regressing unobserved confounder u on outcome y after conditioning on observed covariates w and treatment t
  
  :returns: Python dictionary with information about partial R^2 of confounders with treatment and outcome and bias adjusted variables
docstr_tok: ["Computes","the","bias","adjusted","estimate",",","standard","error",",","t-value",",","partial","R2",",","confidence","intervals",":","param","r2tu_w",":","partial","r^2","from","regressing","unobserved","confounder","u","on","treatment","t","after","conditioning","on","observed","covariates","w",":","param","r2yu_tw",":","partial","r^2","from","regressing","unobserved","confounder","u","on","outcome","y","after","conditioning","on","observed","covariates","w","and","treatment","t",":","returns",":","Python","dictionary","with","information","about","partial","R^2","of","confounders","with","treatment","and","outcome","and","bias","adjusted","variables"]
code: def compute_bias_adjusted(self, r2tu_w, r2yu_tw):
      """
      Computes the bias adjusted estimate, standard error, t-value,  partial R2, confidence intervals
  
      :param r2tu_w: partial r^2 from regressing unobserved confounder u on treatment t after conditioning on observed covariates w
      :param r2yu_tw: partial r^2 from regressing unobserved confounder u on outcome y after conditioning on observed covariates w and treatment t
  
      :returns: Python dictionary with information about partial R^2 of confounders with treatment and outcome and bias adjusted variables
      """
  
      bias_factor = np.sqrt((r2yu_tw * r2tu_w) / (1 - r2tu_w))
      bias = bias_factor * (
          self.standard_error * np.sqrt(self.degree_of_freedom)
      )
  
      if self.confounder_increases_estimate:
          bias_adjusted_estimate = np.sign(self.estimate) * (
              abs(self.estimate) - bias
          )
      else:
          bias_adjusted_estimate = np.sign(self.estimate) * (
              abs(self.estimate) + bias
          )
  
      bias_adjusted_se = (
          np.sqrt((1 - r2yu_tw) / (1 - r2tu_w))
          * self.standard_error
          * np.sqrt(
              self.degree_of_freedom / (self.degree_of_freedom - 1)
          )
      )
  
      bias_adjusted_t = (
          bias_adjusted_estimate - self.null_hypothesis_effect
      ) / bias_adjusted_se
  
      bias_adjusted_partial_r2 = bias_adjusted_t**2 / (
          bias_adjusted_t**2 + (self.degree_of_freedom - 1)
      )  # partial r2 formula used with new t value and dof - 1
  
      num_se = t.ppf(
          self.significance_level / 2, self.degree_of_freedom
      )  # Number of standard errors within Confidence Interval
  
      bias_adjusted_upper_CI = (
          bias_adjusted_estimate - num_se * bias_adjusted_se
      )
      bias_adjusted_lower_CI = (
          bias_adjusted_estimate + num_se * bias_adjusted_se
      )
  
      benchmarking_results = {
          "r2tu_w": r2tu_w,
          "r2yu_tw": r2yu_tw,
          "bias_adjusted_estimate": bias_adjusted_estimate,
          "bias_adjusted_se": bias_adjusted_se,
          "bias_adjusted_t": bias_adjusted_t,
          "bias_adjusted_lower_CI": bias_adjusted_lower_CI,
          "bias_adjusted_upper_CI": bias_adjusted_upper_CI,
      }
  
      return benchmarking_results
  
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 5 for calling the LinearSensitivityAnalyzer obj's underlying member method code with example usage: obj.compute_bias_adjusted(r2tu_w, r2yu_tw) and returns: benchmarking_results