Identifying Latent Structures In Panel Data