Giter Club home page Giter Club logo

ttest2stan's Introduction

ttest2stan

二群の平均値の差に関して,伝統的心理統計ではt検定を行いますが,ベイズ統計学的アプローチでは正規分布に関する事後分布から直接比較を行います。 

使い方

この関数は,あたかも伝統的心理統計で行われてきたt検定の関数のように,二群の平均値の差をベイズ的に検討するものです。 Rのもつt.test関数では,帰無仮説を$H_0:\mu_1=\mu_2$,対立仮説を$H_1:\mu_1 \neq \mu_2$としますが,このttest2stan関数は$\mu_1 > \mu_2$という仮説が成立する割合を返します。

書き方

ttest2stan(x,y,c,iter=2000,warmup=1000,chains=4)

引数

引数 説明
x,y 比較する二つのデータです
c ttest2stanは第一の仮説として$$\mu_2 - \mu_1 \gt 0$$を検定しますが,第二の仮説として$$\mu_2 - \mu_1 \gt c$$を検証します。デフォルトは$0$になっていますが,実数を指定することが可能です。
iter stanで反復する回数を指定します。デフォルトは2000です。
warmup stanで反復する際のウォームアップ回数を指定します。デフォルトは1000です。
chains stanで構成するMCMCチェインの数を指定します。デフォルトは4です。

出力

基本的にstanのprint関数で出力されるものがそのまま出てきます。

出力 説明
mu1,mu2 x,yの推定された平均値です
sigma1,sigma2 x,yの推定された標準偏差です。
delta 生成量での平均値の差です。
d_over $\mu_2 - \mu_1 \gt 0$になった割合です。
d_overC $\mu_2 - \mu_1 \gt C$になった割合です。

参考文献

豊田秀樹編著(2015) 基礎からのベイズ統計学 朝倉書店

ttest2stan's People

Contributors

kosugitti avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.