# NOT RUN {
#analysis original data
data_o <- data.frame(y=ChickWeight$weight,g=ChickWeight$Diet)
post <- Gibbs.ANOVA(data_o)
#analysis new data
data_r <- data.frame(y=rnorm(660, mean(data_o$y), sd=sd(data_o$y)),g=round(runif(660,1,4)))
n.r = as.numeric(table(data_r$g))
#create matrices HR: g4>(g1,g2,g3). g4-g1>0.8, g4-g2>0.5, g4-g3>0.2
HR <- create_matrices(varnames = c("g1","g2","g3","g4"),
hyp = "g4-g1>0.8 & g4-g2>0.5 & g4-g3>0.2")
Amat <- HR$Amat
difmin <- HR$difmin
r.F.dif.efsz <- Fbar.dif(data_r,Amat,difmin,effectsize=TRUE)
#prior predictive check
result <- prior.predictive.check(n=n.r,posterior=post$posterior,F_n=r.F.dif.efsz,statistic="dif",
effectsize=TRUE,Amat=Amat,difmin=difmin,seed=1)
result$sumFdist #summary of the f(F_y_sim)
result$ppp #the prior predictive p-value
# }
Run the code above in your browser using DataLab