BANOVA-package: BANOVA: Hierarchical Bayesian ANOVA Models

BANOVA-packageR Documentation

BANOVA: Hierarchical Bayesian ANOVA Models

Description

This package includes several hierarchical Bayes Analysis of Variance models. These models are suited for the analysis of experimental designs in which both within- and between- subjects factors are manipulated, and account for a wide variety of distributions of the dependent variable. Floodlight analysis and mediation analysis basaed on these models are also provided. The package uses 'Stan' and 'JAGS' as the computational platform.

Details

Package: BANOVA
Type: Package
Version: 1.2.1
Date: 2022-06-18
License: GPL (>= 2)

Model:
E(y_i) = g^{-1}(η_i)
where η_i = ∑_{p = 0}^{P}∑_{j=1}^{J_p}X_{i,j}^pβ_{j,s_i}^p, s_i is the subject id of data response i. Missing values (NAs) of y_i are allowed. The within-subjects factors and their interactions are indexed by p (p = 1,2,.,P). Each index p represents a batch of J_p coefficients: β_{j,s}^p, j = 1,.,J_p;s = 1,.,S indexes subjects. Note that if the subject-level covariate is continuous, J_p=1, so that ANCOVA models are also accommodated (relaxing their "constant slope" assumption).

The population-level model allows for heterogeneity among subjects, because the subject-level coefficients β_{j,s}^p are assumed to follow a multivariate normal distribution.The between-subjects factors and their interactions are indexed by q,(q = 1,2,.,Q), q = 0 denotes the constant term. The population-level ANOVA can be written as:
β_{j,s}^p = ∑_{q = 0}^Q θ_{j,k_s^q}^{pq} + δ_{j,s}^p

The population-level ANCOVA model can be expressed as a linear model with a design matrix Z that contains all between-subjects factors and their interactions and a constant term:
β_{j,s}^p = ∑_{k = 1}^Q Z_{s,k}θ_{j,k}^{p} + δ_{j,s}^p
where Z_{s,k} is an element of Z, a S \times Q matrix of covariates. θ_{j,k}^p is a hyperparameter which captures the effects of between-subjects factor q on the parameter β_{j,s}^p of within-subjects factor p. The error δ_{j,s}^p is assumed to be normal: δ_{j,s}^p ~ N(0,σ_p^{-2} ). Proper, but diffuse priors are assumed: θ_{j,k}^p ~ N(0,γ), and σ_p^{-2} ~ Gamma(a,b), where γ,a,b are hyper-parameters. The default setting is γ = 10^{-4}, a = 1, b = 1.

Note that missing values of independent variables are currently not allowed in the package.

Author(s)

Chen Dong; Michel Wedel

Maintainer: Chen Dong <cdong@math.umd.edu>

References

Dong, C. and Wedel, M. (2017) BANOVA: An R Package for Hierarchical Bayesian ANOVA, Journal of Statistical Software, Vol. 81, No.9, pp. 1-46.

McCullagh, P., Nelder, JA. (1989) Generalized linear models, New York, NY: Chapman and Hall.

Gelman, A. (2005) Analysis of variance-why it is more important than ever, Ann. Statist., Vol. 33, No. 1, pp. 1-53.

Rossi, P., Allenby,G., McCulloch, R. (2005) Bayesian Statistics and Marketing, John Wiley and Sons.

Gill, J. (2007) Bayesian Methods for the Social and Behavioral Sciences, Chapman and Hall, Second Edition.

Gelman, A., Carlin, J., Stern, H. and Dunson, D. (2013) Bayesian Data Analysis, London: Chapman and Hall.

Wedel, M. and Dong, C. (2016) BANOVA: Bayesian Analysis of Variance for Consumer Research. Submitted.


BANOVA documentation built on June 21, 2022, 9:05 a.m.