This function exists primarily for use by lsmeans with check.cells=TRUE; however, it may be useful for assessing potential problems before fitting a model.
Usage
empty.cells(form, data)
Arguments
form
A model formula. Only the right-hand side is used.
data
A data.frame. Unlike in lm and related functions, it is not optional.
Value
A list. Each element is associated with a factor or combination of factors where empty cells were found, and contains a data.frame of the factor levels where they occur. If no empty cells are found, an empty list is returned.
Details
Empty cells are defined in the context of the model formula. For example, suppose that we have a factorial design if factors A and B, but there are no data on certain combinations of A and B. If we call empty.cells with the model ~ A*B or A + B + A:B, the empty cells will be identified. However, if we specify the additive model ~ A + B, no empty cells will be identified because this model can make valid predictions for all combinations of A and B.