コード例 #1
0
def test_format_se():
    assert analysis.format_se(0.006) == "(0.01)"
    assert analysis.format_se(0.005) == "(0.01)"
    assert analysis.format_se(0.004) == "(0.0)"
    assert analysis.format_se(1.34) == "(1.34)"
コード例 #2
0
        "m_7th_yr15std",
        "m_8th_yr15std",
        "alg_yr15std",
]:
    te = results.loc[outcome, "te"]
    se = results.loc[outcome, "se"]
    pvalue = (scipy.stats.t.sf(np.abs(te / se), n - 1) * 2
              )  # two-sided pvalue = Prob(abs(t)>tt)

    ws.cell(row=row,
            column=col).value = analysis.coef_with_stars(te,
                                                         pvalue=pvalue,
                                                         n_tests=7,
                                                         digits=2)
    row = row + 1
    ws.cell(row=row, column=col).value = analysis.format_se(se, 2)
    row = row + 1

col = 4
row = 5
for outcome in [
        "r_3rd_yr15std",
        "r_4th_yr15std",
        "r_5th_yr15std",
        "r_6th_yr15std",
        "r_7th_yr15std",
        "r_8th_yr15std",
        "eng1_yr15std",
]:
    te = results.loc[outcome, "te"]
    se = results.loc[outcome, "se"]