31 Assignment 7
Due 11:59pm Wednesday, March 22
The purpose of this assignment is to explore and reinforce concepts in Chapters 11 and 12 of Bringing Bayesian Models to Life.
You may complete this assignment with a partner (i.e., max group size of 2 people). If you chose to work with a partner you only need to submit one assignment, but please make sure both of your names are on it. You may participate in a learning group of any size to complete the assignment, but please submit your own work.
Make sure to show all of your work and computer code, so that your mathematical and numerical results are easily reproducible. In the most basic sense, this is equivalent to “showing your work” as you would with pencil and paper in a mathematics course.
Please save the file as a pdf and name it Yourlastname_Assignment7. Upload this file to Canvas.
Analysis of variance or ANOVA is a widely used statistical modeling framework that uses the linear model. In the simplest case, the framework is used to determine if a treatment (or other factor) is significant or not significant and to estimate treatment effects. In this homework, you will use the a data set on plant growth, which you can access using the R code given below.
library(faraway)
PlantGrowth ?PlantGrowth
Write 3-5 sentence to convince me that you have a firm understanding of the plant growth data set (hint: Type ?PlantGrowth into the R console).
The goal of our analysis is to determine what, if any, the treatment effect has on the dried weight of the study plants. This will be accomplished by using a linear model. Write out the design matrix (i.e., \(\mathbf{X}\)) that enables you to estimate the treatment effects.
Using the Bayesian linear model obtain the posterior distribution of the treatment effect for treatment 1. Show this posterior distribution using a histogram.
Using the Bayesian linear model obtain the posterior distribution of the treatment effect for treatment 2. Show this posterior distribution using a histogram.
Obtain the posterior distribution of the difference between treatment 1 and 2.
Write 4-6 sentence that summarizes the findings of the study. For example, does treatment 2 have an effect on dried plant weight? How certain of you of this effect? Do you judge this effect to be real and meaningful (i.e., large enough in magnitude to matter)?