Gibbs sampler for a normal random sample with a conjugate...

Simulates realisations from the posterior distribution for the population mean, random effect means and precision components in a one-way normal random effects model with a semi-conjugate prior

1 | ```
gibbsReffects(N, initial, priorparam, m, n, ybar, s)
``` |

`N` |
length of MCMC chain |

`initial` |
starting values for the population mean and the precision components |

`priorparam` |
prior parameters a,b,c,d,e,f |

`m` |
number of treatments |

`n` |
vector containing the number of observations on each treatment |

`ybar` |
vector containing the mean of observations on each treatment |

`s` |
vector containing the standard deviation of observations on each treatment |

1 2 3 4 5 | ```
data(contamination)
n=tapply(contamination$acc,contamination$keyboard,length)
ybar=tapply(contamination$acc,contamination$keyboard,mean)
s=sqrt(tapply(contamination$acc,contamination$keyboard,var)*(n-1)/n)
mcmcAnalysis(gibbsReffects(N=100,initial=c(200,2e-5,1),priorparam=c(200,0.1,0.1,0.1,0.1,0.1),m=10,n=n,ybar=ybar,s=s))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.