Ben Stokes has confirmed that James Anderson will miss England's third Test with New Zealand through injury.