I'm working my way through a Coursera Course and could use an explanation of how to do the code for this question:
To quantify the magnitude of the differences in mean birth weight, we can use a credible interval. Change the
"ci"to construct and record a credible interval for the difference between the weights of babies born to nonsmoking and smoking mothers, and interpret this interval in context of the data. Note that by default you'll get a 95% credible interval. If you want to change the confidence level, change the value for
cred_levelwhich takes on a value between 0 and 1. Also note that when doing a credible interval arguments like
alternativeare not useful, so make sure to remove them, but include the prior mean
This is what I have:
bayes_inference(y = weight, x = habit, data = nc_fullterm, statistic = "mean", type = "ci", null = 0, prior = "JZS", mu_0 = 7.7, rscale = sqrt(2)/2, method = "theoretical", cred_level = 0.95)
And I'm getting this error:
Error in BayesFactor::ttestBF(x = y1, y = y2, mu = mu_0, rscale = rscale, : Use of nonzero null hypothesis not implemented for independent samples test.
I'm not quite sure what this means (assume I'm a complete beginner here).
If I leave the alternative and null arguments in, it seems to work. Any ideas?