ThinkStats (19)

勉強会の空き時間 (?) にて。
継続は hypothesis.Test あたり。DifferenceInMean ですが delta は算術平均の差分になってますね。

def DifferenceInMean(actual1, actual2):
    """Computes the difference in mean between two groups.

    Args:
        actual1: sequence of float
        actual2: sequence of float

    Returns:
        tuple of (mu1, mu2, mu1-mu2)
    """
    mu1 = thinkstats.Mean(actual1)
    mu2 = thinkstats.Mean(actual2)
    delta = mu1 - mu2
    return mu1, mu2, delta

確かに delta は第一子とそれ以外の妊娠期間の平均の差分、とありますね。
で、以下を出力してるのは PValue という手続きか。

(Mean, Var) of resampled deltas (-0.00169117178270686, 0.0030938100255098588)
Tails (left, right, total): 0.084 0.079 0.163

というか

以下の違いと言いますか

    # P(E|H0)
    peh0 = Test(root + '_deltas_cdf',
                actual1, actual2, pool, pool,
                iters, plot=True)

    # P(E|Ha)
    peha = Test(root + '_deltas_ha_cdf',
               actual1, actual2, model1, model2,
               iters)

以下の出力の違いについてきちんと理解したいのですが

(Mean, Var) of resampled deltas (-0.00169117178270686, 0.0030938100255098588)
Tails (left, right, total): 0.084 0.079 0.163

(中略

(Mean, Var) of resampled deltas (0.08077549196467845, 0.003143562170784472)
Tails (left, right, total): 0.001 0.515 0.516

今日はちょい無理です。面白いのですがちょい無理。