LoginSignup
2
2

More than 5 years have passed since last update.

python 統計 t-test

Last updated at Posted at 2018-05-04

ググったら、pythonでのt-検定のやり方が日本語で少なかったため、メモ。

1、_indと_rel
t-検定 scipy.stats.ttest_ind()
対応のあるt-検定 scipy.stats.ttest_rel()(自信ない)

2、P値とt値
P値は以下でみれる。
scipy.stats.ttest_ind().pvalue

t値は以下でみれる。(自身ない)
scipy.stats.ttest_ind().statistic

3、stats.ttest_ind(df_true["age"],df_false["age"])
引数は、pandasのデータフレームから列指定(シリーズ)を二つ並べたらできた。

参考リンク
https://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.stats.ttest_rel.html
https://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.stats.ttest_ind.html#scipy-stats-ttest-ind
http://esu-ko.hatenablog.com/entry/2016/03/07/%E3%83%87%E3%83%BC%E3%82%BF%E3%82%B5%E3%82%A4%E3%82%A8%E3%83%B3%E3%82%B9%E3%82%92Python%E3%81%A7%E8%A9%A6%E3%81%99%281%3A%E6%A4%9C%E5%AE%9A%29

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2