antivax-attitudes

Reanalyses of data from Horne, Powell, Hummel & Holyoak (2015)
git clone https://git.eamoncaddigan.net/antivax-attitudes.git
Log | Files | Refs | README | LICENSE

commit bebd70b28622e0ed17531e6017c26d13364b2534
parent 9da526b0592e7ce40e0ce310451391ccf2456149
Author: eamoncaddigan <eamon.caddigan@gmail.com>
Date:   Sun, 30 Aug 2015 22:55:47 -0400

Posteriors.

Diffstat:
Mantivax-attitudes.Rmd | 30++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/antivax-attitudes.Rmd b/antivax-attitudes.Rmd @@ -291,9 +291,9 @@ diagMCMC(codaObject = codaSamples, saveName = NULL) ``` -It's also important to check the predictions made by a model, "[we cannot really interpret the parameters of the model very meaningfully when the model doesn't describe the data very well](http://doingbayesiandataanalysis.blogspot.com/2015/08/a-case-in-which-metric-data-are-better.html)". Here are response histograms for each question, averaged across the levels of the other factors. Model predictions are superimposed on the histograms, along with the 95% HDI for each response (which is hidden behind the points). +It's also important to check the predictions made by a model, "[we cannot really interpret the parameters of the model very meaningfully when the model doesn't describe the data very well](http://doingbayesiandataanalysis.blogspot.com/2015/08/a-case-in-which-metric-data-are-better.html)". Here are response histograms for each question, averaged across the levels of the other factors. Model predictions are superimposed on the histograms, along with the 95% HDI for each response (which are hidden behind the points). -```{r, echo=FALSE, fig.width=3.5, fig.height=2.5} +```{r, echo=FALSE, fig.width=4, fig.height=2.5} source("ggPostPlot.R") for (x1Level in seq_along(levels(questionnaireData$question))) { @@ -303,4 +303,30 @@ for (x1Level in seq_along(levels(questionnaireData$question))) { } ``` +Since there were no problems with sampling, and the model appears to do a good job of describing the data, we can look at parameters to see effects. First, we'll look at the interaction parameter estimates to compare the change in attitude for each intervention group. +```{r echo=FALSE, fig.width=3, fig.height=3} +mcmcMat <- as.matrix(codaSamples) + +for (x2Level in seq_along(levels(questionnaireData$intervention))) { + plotPost(mcmcMat[, paste0("b2b3[", x2Level, ",2]")] - mcmcMat[, paste0("b2b3[", x2Level, ",1]")], + main = paste0(levels(questionnaireData$intervention)[x2Level], "\nposttest - pretest"), + compVal = 0.0, + xlab = "posterior density") +} +``` + +Only the "disease risk" group had a positive shift in vaccination attitudes overall. We can also use the posterior distributions to directly estimate the shifts relative to the control group. + +```{r echo=FALSE, fig.width=4, fig.height=3} +controlLevel = which(levels(questionnaireData$intervention) == "Control") +for (x2Level in which(levels(questionnaireData$intervention) != "Control")) { + plotPost((mcmcMat[, paste0("b2b3[", x2Level, ",2]")] - mcmcMat[, paste0("b2b3[", x2Level, ",1]")]) - + (mcmcMat[, paste0("b2b3[", controlLevel, ",2]")] - mcmcMat[, paste0("b2b3[", controlLevel, ",1]")]), + compVal = 0.0, + main = paste0(levels(questionnaireData$intervention)[x2Level], "\nchange vs. Control"), + xlab = "posterior density") +} +``` + +Using a Bayesian estimation, we have replicated the findings of Horne and colleagues. The posterior distribution above shows that "disease risk" participants shifted their response about half an interval relative to the control group following the intervention. The "autism correction" participants, however, were no more likely to vaccinate than the control group.