using R to compute gelman factors