示例#1
0
def beta_diag_lag(reg, robust):
    # compute diagnostics
    reg.std_err = diagnostics.se_betas(reg)
    reg.z_stat = diagnostics.t_stat(reg, z_stat=True)
    reg.pr2 = diagnostics_tsls.pr2_aspatial(reg)
    reg.pr2_e = diagnostics_tsls.pr2_spatial(reg)
    # organize summary output
    reg.__summary["summary_std_err"] = robust
    reg.__summary["summary_zt"] = "z"
    reg.__summary["summary_r2"] = "%-20s:      %5.4f\n" % ("Pseudo R-squared", reg.pr2)
    reg.__summary["summary_r2"] += "%-20s:  %5.4f\n" % ("Spatial Pseudo R-squared", reg.pr2_e)
示例#2
0
def beta_diag_lag(reg, robust):
    # compute diagnostics
    reg.std_err = diagnostics.se_betas(reg)
    reg.z_stat = diagnostics.t_stat(reg, z_stat=True)
    reg.pr2 = diagnostics_tsls.pr2_aspatial(reg)
    reg.pr2_e = diagnostics_tsls.pr2_spatial(reg)
    # organize summary output
    reg.__summary['summary_std_err'] = robust
    reg.__summary['summary_zt'] = 'z'
    reg.__summary['summary_r2'] = "%-20s:      %5.4f\n" % ('Pseudo R-squared',
                                                           reg.pr2)
    reg.__summary['summary_r2'] += "%-20s:  %5.4f\n" % (
        'Spatial Pseudo R-squared', reg.pr2_e)
示例#3
0
def beta_diag_lag(reg, robust, error=True):
    # compute diagnostics
    reg.std_err = diagnostics.se_betas(reg)
    reg.z_stat = diagnostics.t_stat(reg, z_stat=True)
    reg.pr2 = diagnostics_tsls.pr2_aspatial(reg)
    # organize summary output
    reg.__summary['summary_std_err'] = robust
    reg.__summary['summary_zt'] = 'z'
    reg.__summary['summary_r2'] = "%-20s:      %5.4f\n" % ('Pseudo R-squared',reg.pr2)
    if (error and np.abs(reg.betas[-2])<1) or (not error and np.abs(reg.betas[-1])<1):
        reg.pr2_e = diagnostics_tsls.pr2_spatial(reg)
        reg.__summary['summary_r2'] += "%-20s:  %5.4f\n" % ('Spatial Pseudo R-squared',reg.pr2_e)
    else:
        reg.__summary['summary_r2'] += "Spatial Pseudo R-squared: omitted due to rho outside the boundary (-1, 1)."
示例#4
0
def beta_diag_lag(reg, robust, error=True):
    # compute diagnostics
    reg.std_err = diagnostics.se_betas(reg)
    reg.z_stat = diagnostics.t_stat(reg, z_stat=True)
    reg.pr2 = diagnostics_tsls.pr2_aspatial(reg)
    # organize summary output
    reg.__summary['summary_std_err'] = robust
    reg.__summary['summary_zt'] = 'z'
    reg.__summary['summary_r2'] = "%-20s:      %5.4f\n" % ('Pseudo R-squared',
                                                           reg.pr2)
    if np.abs(reg.rho) < 1:
        reg.pr2_e = diagnostics_tsls.pr2_spatial(reg)
        reg.__summary['summary_r2'] += "%-20s:  %5.4f\n" % (
            'Spatial Pseudo R-squared', reg.pr2_e)
    else:
        reg.__summary[
            'summary_r2'] += "Spatial Pseudo R-squared: omitted due to rho outside the boundary (-1, 1)."