The Dungeon Master's Guide contains copious rules for estimating the effects of traits on a creature's Challenge Rating. Some, of course, have greater effects than others. The DMG itself points out that class levels are of great value to low-level monsters, while,
...the hit points, spells, and other class features that an ancient red dragon gains from five levels of wizard don't increase its challenge rating. (DMG 283)
Some common enough traits are listed for in the tables in the DMG, but spellcasting is called out on page 279 as a special case, mentioning that only spells that increase the monster's damage output or hp/AC need be considered.
Some combinations are more potent than others. Relevant OotS. It is in fact this situation which I wish to explore. Damage spells are easy to calculate, spells like Shield can be factored into AC, but this goes above and beyond.
An Antimagic Field is way more powerful than a Balor's Magic Resistance or even immunity to all spell damage, which I would peg itself as somewhat more valuable than the "HP Multiplier for Immunities" on DMG 278. It even stops non-damage effects like a Hold Monster or Banishment.
This would have to be one of the most weighty additions to a monster; how could you calculate its impact on the encounter?
Though Wizards stated somewhere (can't remember which book) that switching spells of a monster for ones of the same class and level had no effect on CR, Antimagic Field seems more powerful for a monster than anything that it might switch with. It shuts down casters and, unless multiple of them counterspell the casting (the monster will presumably counterspell the counterspell), it lengthens the battle by several rounds, even if the creature eventually fails a CON save.
This effect actually gets more powerful with level; a third level caster only has 6 slots to spend a day anyways, and presumably has a backup bow/sling/throwing dagger. At higher levels, classes with multiattack consign such efforts to irrelevance.
The easiest way to balance this that I can see would be to assume the casters are inactive for the duration of the battle for the purposes of calculating the difficulty. Healers would still likely help, but warlocks or sorcerers would have few options.
How would you balance this numerically? Boost Effective HP? Assume fewer PCs? Make an analogy to another trait? Has anybody backcalculated what it's worth to a Beholder, Raksasha, Flail Snail, or Tarrasque? (If so, I'd love to see the math)
Lastly, I do realize this shuts down spellcasters especially hard, but a human mage could do the same thing. My spellcasters regularly obviate encounters with Banishment or upcasting of Hold Person/Monster; it's fine to let the non-casters completely dominate the battle this once.