A statistical test for intermediate structure