Résumé : This paper considers a linear panel data model with reduced rank regressors and interactive fixed effects. The leading example is a factor model where some of the factors are observed, some others not. Invariance considerations yield a maximal invariant statistic whose density does not depend on incidental parameters. It is natural to consider a likelihood ratio test based on the maximal invariant statistic. Its density can be found by using as a prior the unique invariant distribution for the incidental parameters. That invariant distribution is least favorable and leads to minimax optimality properties. Combining the invariant distribution with a prior for the remaining parameters gives a class of admissible tests. A particular choice of distribution yields the spiked covariance model of Johnstone (2001). Numerical simulations suggest that the maximal invariant likelihood ratio test outperforms the standard likelihood ratio test. Tests which are not invariant to data transformations (i) are uniquely represented as randomized tests of the maximal invariant statistic and (ii) do not solve the incidental parameter problem.