2
$\begingroup$

Probably a very basic question, but I have a contingency table formed of 3 categorical variables (one with 3 levels, the rest with 2) and have been asked to try to test the association between them using log-linear modelling. However, the output I get states that residuals are all zero, and remain so regardless of what I specify as the model (e.g. saturated, or just the one variable, or an interaction etc.). I know from other analyses that there is not a perfect relationship between these variables.

What does this mean in terms of the model? Is it an indication that it violates assumptions?


Edited to add the output table:

output table

This is for a model containing the interaction term (which is what we're interested in).

$\endgroup$
  • $\begingroup$ Without knowing more detail it is hard to tell. I suspect you may be taking the log of 0 counts, which results in NA's, which are dropped from the analysis by the software you are using, leaving only a few cases. $\endgroup$ – VictorZurkowski Sep 4 '17 at 12:50
  • $\begingroup$ Hi @VictorZurkowski - we don't have any 0 counts in the data (the lowest is >130). We have 12 sets of counts in total, in case that helps at all. $\endgroup$ – DrJay Sep 4 '17 at 12:58
  • $\begingroup$ I think it is an indication that you are fitting the wrong model, indeed the saturated one. Could you provide us with output of the software? $\endgroup$ – Knarpie Sep 4 '17 at 15:39
  • $\begingroup$ @Knarpie - I've added an image of the output. Thanks! $\endgroup$ – DrJay Sep 5 '17 at 8:50
3
$\begingroup$

This is indeed a perfect fit. The command "Constant + Time * Condition*OutcomeType" must mean that a saturated model is fitted, i.e. with all possible two-way and three-way interactions. Check the help-files of your software to fit the model you want to.

$\endgroup$
  • $\begingroup$ It's this interaction that we're wanting to test though (the individual variables on their own don't really mean much outside of this interaction). Is there another way we should be testing this? $\endgroup$ – DrJay Sep 6 '17 at 10:42
  • $\begingroup$ Also I should add that even if an individual variable is added to the model without this interaction, it's the same result $\endgroup$ – DrJay Sep 6 '17 at 10:45
  • $\begingroup$ @DrJay This is simply not possible, you can never get a perfect fit with only one variable if you know there is no perfect relationship. Please check and double check that your model is doing what you think it does. If you show us output from the more limited model we can perhaps help you further. To test the significance of interaction terms you need to fit the simpler model, or use a Wald-type test. $\endgroup$ – Knarpie Sep 6 '17 at 11:44
  • $\begingroup$ Yes, sorry, you're quite right - I was taking the variables out of the analysis (so that only one remained) but keeping the 'saturated model' option checked in error. $\endgroup$ – DrJay Sep 6 '17 at 14:56
  • $\begingroup$ @DrJay You're welcome, we are all here to learn. Kindly accept my answer if you think my help was useful :-) $\endgroup$ – Knarpie Sep 6 '17 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.