Package 'bayest'

Title: Effect Size Targeted Bayesian Two-Sample t-Tests via Markov Chain Monte Carlo in Gaussian Mixture Models
Description: Provides an Markov-Chain-Monte-Carlo algorithm for Bayesian t-tests on the effect size. The underlying Gibbs sampler is based on a two-component Gaussian mixture and approximates the posterior distributions of the effect size, the difference of means and difference of standard deviations. A posterior analysis of the effect size via the region of practical equivalence is provided, too. For more details about the Gibbs sampler see Kelter (2019) <arXiv:1906.07524>.
Authors: Riko Kelter
Maintainer: Riko Kelter <[email protected]>
License: GPL-3
Version: 1.5
Built: 2024-11-02 02:40:39 UTC
Source: https://github.com/cran/bayest

Help Index


Effect Size Targeted Bayesian Two-Sample t-Tests via Markov Chain Monte Carlo in Gaussian Mixture Models

Description

Provides an Markov-Chain-Monte-Carlo algorithm for Bayesian t-tests on the effect size. The underlying Gibbs sampler is based on a two-component Gaussian mixture and approximates the posterior distributions of the effect size, the difference of means and difference of standard deviations. A posterior analysis of the effect size via the region of practical equivalence is provided, too. For more details about the Gibbs sampler see Kelter (2019) <arXiv:1906.07524>.

Details

Package for conducting Bayesian two-sample t-tests based on a two-component Gaussian mixture model via Gibbs sampling.

Package: bayest
Type: Package
Title: Effect Size Targeted Bayesian Two-Sample t-Tests via Markov Chain Monte Carlo in Gaussian Mixture Models
Version: 1.5
Date: 2024-04-05
Author: Riko Kelter
Maintainer: Riko Kelter <[email protected]>
Description: Provides an Markov-Chain-Monte-Carlo algorithm for Bayesian t-tests on the effect size. The underlying Gibbs sampler is based on a two-component Gaussian mixture and approximates the posterior distributions of the effect size, the difference of means and difference of standard deviations. A posterior analysis of the effect size via the region of practical equivalence is provided, too. For more details about the Gibbs sampler see Kelter (2019) <arXiv:1906.07524>.
Imports: MCMCpack
Suggests: coda, MASS
License: GPL-3
NeedsCompilation: no
Packaged: 2024-04-05 06:52:48 UTC; riko
Date/Publication: 2024-04-05 07:12:59 UTC
Repository: https://riko-k.r-universe.dev
RemoteUrl: https://github.com/cran/bayest
RemoteRef: HEAD
RemoteSha: 45fd89f2cc1b14cc5e4365b1a3690368530e9341

Index of help topics:

bayes.t.test            bayesttest
bayest-package          Effect Size Targeted Bayesian Two-Sample
                        t-Tests via Markov Chain Monte Carlo in
                        Gaussian Mixture Models

Author(s)

Riko Kelter

Maintainer: Riko Kelter <[email protected]>

References

For a detailed explanation of the underlying Gibbs sampler see: https://arxiv.org/abs/1906.07524v1


bayesttest

Description

The function provides a Bayesian t-test by running a Markov-Chain-Monte Carlo algorithm to produce posterior draws of the means and standard deviations (or variances) of both groups. The posterior distributions of the difference of means, difference of variances or standard deviations and the effect size are also obtained via the underlying Gibbs sampler for the two-component Gaussian mixture model.

Usage

bayes.t.test(n, plot, firstComp, secondComp, hyperpars, ci, burnin, sd, q)

Arguments

n

Number of iterations of the single-block Gibbs sampler used for inference in the two-component Gaussian mixture

plot

A string specifying which plots to include for detailed analysis. "none" is used if only the data frame including the computed posterior MCMC draws should be returned. "all" is used for detailed plots for an analysis based on a Bayesian Hodges-Lehmann test, respectively the region of practical equivalence (ROPE). "samples" is used if a vector of posterior effect size MCMC draws should be returned.

firstComp

A numeric vector representing the values of the first group

secondComp

A numeric vector representing the values of the second group

hyperpars

A string specifying the set of hyperparameters used for the prior distributions. "raftery" uses the standard hyperparameters of Raftery (1996), and "custom" uses modified parameters which are designed to stay weakly informative.

ci

A real number between zero and one representing the credible level used for posterior credible intervals

burnin

An integer which represents the burn-in used for the single-block Gibbs sampler

sd

A string selecting if posterior inference is desired for the variances or standard deviations. "var" approximates the posterior distribution of the variances, "sd" of the standard deviations.

q

A real number for influencing the hyperparameters selected. q=0.1 as weakly informative standard is recommended.

Value

If the option "none" is used for argument plot, a dataframe including the posterior mode, posterior expectation as well as the posterior credible intervals corresponding to the selected credible level will be returned for the difference of means, difference of standard deviations respectively variances and the effect size. If the option "all" is used for argument plot, plots of the posterior distributions of the difference of means, difference of standard deviations respectively variances and the effect size will be returned, including a posterior analysis of the effect size via the region of practical equivalence (ROPE).

Author(s)

Riko Kelter

References

For details, see: https://arxiv.org/abs/1906.07524v1

Examples

x=rnorm(100,mean=0,sd=1)
y=rnorm(100,mean=1,sd=1)
bayes.t.test(n=2500,plot="all",firstComp=x,secondComp=y,
hyperpars="custom",ci=0.95,burnin=1250,sd="sd",q=0.1)