Learn R Programming

bayesanova (version 1.6)

post.pred.check: post.pred.check

Description

Provides a posterior predictive check for a fitted Bayesian ANOVA model.

Usage

post.pred.check(anovafit, ngroups, out, reps = 50, eta)

Value

Produces a plot consisting of a density estimate of the original data and posterior predictive distributions sampled from the posterior of the Bayesian ANOVA model as density overlays.

Arguments

anovafit

A dataframe returned by bayes.anova

ngroups

An integer which is the number of groups used in the ANOVA

out

A numerical vector containing the originally observed data in all groups

reps

An integer which is the number of posterior predictive distributions sampled from the ANOVA models posterior distribution. Defaults to 50 sampled parameters.

eta

A numerical vector containing the weight values of the mixture.

Author

Riko Kelter

Details

Provides a posterior predictive check for a fitted Bayesian ANOVA model.

Examples

Run this code
set.seed(700)
x1=rnorm(1000,0,1)
x2=rnorm(1000,1,1)
x3=rnorm(1000,2,2)

result=bayes.anova(n=1000,first = x1, second=x2, third=x3)
post.pred.check(result, ngroups = 3, out = c(x1,x2,x3), reps = 25, eta = c(1/3,1/3,1/3))

Run the code above in your browser using DataLab