Step-by-step example of Bayesian t-test?

This page summarizes the projects mentioned and recommended in the original post on /r/AskStatistics

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • stan

    Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.

    The ` sigma ~ x` part specifies that sigma should be estimated separately for each group. Note that I'm also using scaled data, since then I can go by the Stan team's [prior choice recommendations](https://github.com/stan-dev/stan/wiki/Prior-Choice-Recommendations). We also specified ` family = gaussian` , which is telling the model to treat ` y` , the difference between the two variables, as normally distributed. In other words, this is the likelihood! There are [lots](https://cran.r-project.org/web/packages/brms/vignettes/brms_families.html) of "families" in brms. In particular, if you use a Student's t distribution instead, your model will be more robust against outliers!

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • brms

    brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan

    Okay so first off, I recommend that you read [this](https://link.springer.com/article/10.3758/s13423-016-1221-4) article about "The Bayesian New Statistics", which highlights estimation rather than hypothesis testing from a Bayesian perspective (see Fig. 1, second row, second column). Instead of a t-test, then, we can *estimate the difference* between two groups/variables. If you want to go deeper than JASP etc, I recommend that you use [brms](https://paul-buerkner.github.io/brms/), or, if you want to go even deeper, [Stan](https://mc-stan.org/) (brms is a front-end to Stan).

  • tests-as-linear

    Common statistical tests are linear models (or: how to teach stats)

    Second, one thing that is often overlooked is that most models can be seen as [variants of linear regression](https://lindeloev.github.io/tests-as-linear/), including t-tests. To estimate the difference between two variables using linear regression (in R), you use `lm(y ~ x, data = data), where `x` is the group variable (factor coded) and `y` is the variable of interest. If you suppress the intercept, you directly estimate the means of the two variables: `lm(y ~ 0 + x, data = data)`` . Finally, the t-test assumes equal variance between groups, which is often [a weird assumption](https://www.rips-irsp.com/articles/10.5334/irsp.82/). Thus we'll make sure to allow variance to differ.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • I have a small sample size time series with potentially lagged predictor values which are also time series. What could be potential methods to analyse these data?

    3 projects | /r/AskStatistics | 25 Apr 2021
  • Stan: Statistical modeling and high-performance statistical computation

    1 project | news.ycombinator.com | 4 Mar 2024
  • Rstan Package in ATPA

    1 project | /r/actuary | 2 Jun 2023
  • [Q] Is there a method for adding random effects to an interval censored time to event model?

    1 project | /r/statistics | 29 May 2023
  • HELP Conjugate Priors in Bayesian Regression in SPSS

    1 project | /r/AskStatistics | 24 May 2023

Did you konow that C++ is
the 6th most popular programming language
based on number of metions?