In this paper we consider inference based on very general divergence measures, under assumptions of multinomial sampling and loglinear models. We define the minimum phi-divergence estimator, which is seen to be a generalization of the maximum likelihood estimator. This estimator is then used in a phi-divergence goodness-of-fit statistic, which is the basis of two new statistics for solving the problem of testing a nested sequence of loglinear models