pvaluedotone commited on
Commit
f876a75
·
verified ·
1 Parent(s): d332a2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -67,9 +67,9 @@ def run_2sls(dependent_var, endogenous_vars, instruments, exogenous_vars):
67
  sargan_p_value = 1 - stats.chi2.cdf(sargan_stat, df=len(instruments) - len(endogenous_vars))
68
 
69
  results = f"2SLS regression results:\n{second_stage.summary()}\n\n"
70
- results += f"Hausman test:\nChi-square(1) = {hausman_stat:.5f}, p-value = {hausman_p_value:.5f}\n"
71
  results += weak_instrument_results + "\n"
72
- results += f"Sargan test:\nSargan statistic = {sargan_stat:.5f}, p-value = {sargan_p_value:.5f}\n"
73
 
74
  return results
75
 
 
67
  sargan_p_value = 1 - stats.chi2.cdf(sargan_stat, df=len(instruments) - len(endogenous_vars))
68
 
69
  results = f"2SLS regression results:\n{second_stage.summary()}\n\n"
70
+ results += f"Hausman test \nNull hypothesis: OLS estimates are consistent\nChi-square(1) = {hausman_stat:.5f}, p-value = {hausman_p_value:.5f}\n"
71
  results += weak_instrument_results + "\n"
72
+ results += f"Sargan test\nNull hypothesis: all instruments are valid\nSargan statistic = {sargan_stat:.5f}, p-value = {sargan_p_value:.5f}\nSargan test (overidentification test) is only applicable when the model is overidentified (IVs > Endogenous X's."
73
 
74
  return results
75