Bayesian inference in threshold models using Gibbs sampling