There are many situations in which a researcher would like to analyse data from a two-way layout. Often, the assumptions of linearity and normality may not hold. To address such situations, we introduce a semiparametric model. The model extends the well-known density ratio model from the one-way to the two-way layout and provides a useful framework for semiparametric analysis of variance type problems under order restrictions. In particular, the likelihood ratio order is emphasized. The model enables highly efficient inference without resorting to fully parametric assumptions or the use of transformations. Estimation and testing procedures under order restrictions are developed and investigated in detail. It is shown that the model is robust to misspecification, and several simulations suggest that it performs well in practice. The methodology is illustrated using two data examples; in the first, the response variable is discrete, whereas in the second, it is continuous.