Simulates realisations from the posterior distribution for the population mean and precision components in a one-way normal random effects model with a semi-conjugate prior. The method marginalises over the random effects and uses univariate normal or log normal random walk proposals for the precision components.

1 2 | ```
mhReffects(N, initial, intau, innu, priorparam, m, n,
ybar, s, show = TRUE, innLogscale = FALSE)
``` |

`N` |
length of MCMC chain |

`initial` |
starting values for the algorithm |

`intau` |
standard deviation of normal random walk innovation for data precision parameter tau |

`innu` |
standard deviation of normal random walk innovation for random effects precision parameter nu |

`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 |

`show` |
logical. If true then acceptance rate for the proposals will be given |

`innLogscale` |
logical. If true then proposals are made on a log scale |

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(mhReffects(N=100,initial=c(200,2e-5,1),intau=1e-5,innu=7.9,priorparam=c(200,0.1,0.1,0.1,0.1,0.1),m=10,n=n,ybar=ybar,s=s,show=TRUE),rows=3)
``` |

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

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