A multilevel latent variable model for multidimensional and longitudinal data