Estimating the mean value using R2jags This file was generated on 2013-03-06 18:32:36 Load the libraries. library(plyr) library(reshape2) library(ggplot2) library(gridExtra) library(R2jags) library(mcmcplots) library(xtable) Make data Make some simulated data to analyze. This way, we know the true mean and standard errrors. Here, we make two sets of data with different number of samples. In the small set, we have 6 samples from a normal distribution with a mean of 600 and a standard error of 30. In the big set, we have 1000 samples from the same normal distribution. smallset = rnorm(6, mean = 600, sd = 30) bigset = rnorm(1000, mean = 600, sd = 30) GLM Histogram plots p1 = ggplot() + geom_histogram(aes(x = smallset)) + labs(x = "Small set of 10 samples") p2 = ggplot() + geom_histogram(aes(x = bigset)) + labs(x = "Big set of 1000 samples") grid.arrange(p1, p2) The GLM for the small dataset m1 = glm(smallset ~ 1, family = gaussian) ...