I was told to use Bayesian inference instead of working only analytically with polling data. However, I have a problem; I have a small dataset with guesses about prior distributions for the parties, and I have data from polls. How can I obtain marginals from Gibbs simulations?
prior <- a <- c(.30, .15, .15, .10, .10, .08, .12)
polls <- data.frame(rbind(
a <- c(.24, .23, .20, .11, .08, .08, .06, 3959, .02),
b <- c(.22, .22, .22, .11, .07, .08, .08, 1024, .03),
c <- c(.23, .25, .19, .11, .07, .08, .06, 2099, .02),
d <- c(.19, .27, .18, .10, .04, .08, .06, 1024, .03),
e <- c(.22, .30, .18, .09, .07, .08, .06, 1799, .02)
))
names(polls) <- c("Cons", "Lib", "Lab", "Ind", "Others", "Null", "Swingy",
"Sample.size", "Err")