Essays on Factor Models and Latent Variables in Economics