Loglinear Models with Missing Data: A Latent Class Approach