  Niobium superconducting radio-frequency (SRF) cavities for high energy
accelerator applications have been greatly improved in terms of the quality
factor $Q$ by techniques such as Nitrogen doping. However, the mechanisms
leading improvement in $Q$ are still not fully understood. Quite recently the
SRF group at Fermilab measured anomalies in the frequency shift of N-doped SRF
Niobium cavities near the transition temperature. Here we report our
theoretical analysis of these results based on the microscopic theory of
superconductivity that incorporates anisotropy of the superconducting gap and
inhomogeneous disorder in the screening region of the SRF cavities. We are able
to account for frequency shift anomalies very close to $T_c$ of the order of
fractions of a kHz. Our results for the frequency shift and Q are in good
agreement with the experimental data reported for all four N-doped Nb SRF
cavities by Bafia et al. We also compare our theory with an earlier report of
on a Nb sample measured at 60 GHz. We also show that the quality factor
calculated theoretically has a peak of upper convexity with the largest $Q$ at
intermediate levels of disorder. For strong disorder, i.e. the dirty limit,
pair breaking in the presence of disorder and screening currents limits the
$Q$.
