  The Alekseev-Gr{\"o}bner lemma is combined with the theory of modified
equations to obtain an \emph{a priori} estimate for the global error of
numerical integrators. This estimate is correct up to a remainder term of order
$h^{2p}$, where $h$ denotes the step size and $p$ the order of the method. It
is applied to a class of nonautonomous linear oscillatory equations, which
includes the Airy equation, thereby improving prior work which only gave the
$h^p$ term.
  Next, nonlinear oscillators whose behaviour is described by the Emden-Fowler
equation $y'' + t^\nu y^n = 0$ are considered, and global errors committed by
Runge-Kutta methods are calculated. Numerical experiments show that the
resulting estimates are generally accurate. The main conclusion is that we need
to do a full calculation to obtain good estimates: the behaviour is different
from the linear case, it is not sufficient to look only at the leading term,
and merely considering the local error does not provide an accurate picture
either.
