Skip to content
RDocumentation: bayes.t.test
Note that this notebook was automatically generated from an RDocumentation page. It depends on the package and the example code whether this code will run without errors. You may need to edit the code to make things work.
Run error
if(!require('BayesianFirstAid')) {
install.packages('BayesianFirstAid')
library('BayesianFirstAid')
}
Run error
# Using Student's sleep data as in the t.test example
# bayes.t.test can be called in the same way as t.test
# so you can both supply two vectors...
bayes.t.test(sleep$extra[sleep$group == 1], sleep$extra[sleep$group == 2])
# ... or use the formula interface.
bayes.t.test(extra ~ group, data = sleep)
# Save the return value in order to inspect the model result further.
fit <- bayes.t.test(extra ~ group, data = sleep)
summary(fit)
plot(fit)
# MCMC diagnostics
diagnostics(fit)
# Print out the R code to run the model. This can be copy n' pasted into
# an R-script and further modified.
model.code(fit)