【问题标题】:T-statistics calculated from bootstrapped standard error从自举标准误差计算的 T 统计量
【发布时间】:2020-05-01 07:17:43
【问题描述】:

请问有人知道是否有一个库可以根据引导标准错误而不是 python 中的常规标准错误来计算 t 统计量?找了很久,好像没有人啊……先谢谢了。

【问题讨论】:

  • 不幸的是,软件推荐离题了。

标签: python t-test standard-error


【解决方案1】:

Bootstrapping 可以在 Python 中使用bootstrapped 包(GitHubPyPI)执行:

import numpy as np
import bootstrapped.bootstrap as bs
import bootstrapped.stats_functions as bs_stats

mean = 100
stdev = 10

population = np.random.normal(loc=mean, scale=stdev, size=50000)

# take 1k 'samples' from the larger population
samples = population[:1000]

print(bs.bootstrap(samples, stat_func=bs_stats.mean))
>> 100.08  (99.46, 100.69)

print(bs.bootstrap(samples, stat_func=bs_stats.std))
>> 9.49  (9.92, 10.36)

【讨论】:

    猜你喜欢
    • 2021-02-07
    • 2015-11-20
    • 1970-01-01
    • 1970-01-01
    • 2018-11-07
    • 1970-01-01
    • 1970-01-01
    • 2016-04-14
    • 1970-01-01
    相关资源
    最近更新 更多