The contributions to the macroscopic-anisotropy constants and resonance energy from crystal-field anisotropy, magnetoelastic effects in the frozen and flexible lattice model, and two-ion interactions have been found for all terms allowed in a crystal of hexagonal symmetry. The temperature dependence is expressed as expansions of thermal averages of the Stevens operators $〈{O}_{l}^{m}〉$. A systematic spin-wave theory, renormalized in the Hartree-Fock approximation, is developed and used to find the temperature dependence of the Stevens operators and the resonance energy in terms of the magnetization-deviation parameter $\ensuremath{\Delta}M(T)$ and the parameter $b(T)$, which characterizes the nonsphericity of the moment precession. Significant deviations from the classical $\frac{l(l+1)}{2}$ temperature law are found. The inclusion of $b(T)$ gives rise to important reinterpretations of the contributions to the resonance energy. Numerical results are given for the magnetization agreeing with experiment for Gd, Tb, and Dy. For Tb and Dy the zero-point deviations were found to be $0.05{\ensuremath{\mu}}_{B}$ and $0.08{\ensuremath{\mu}}_{B}$, respectively, and the ratio $\frac{[b(T)\ensuremath{-}b(0)]}{[\ensuremath{\Delta}M(T)\ensuremath{-}\ensuremath{\Delta}M(0)]}$ is approximately $\frac{1}{3}$ for all temperatures below 100 K. This gives rise to large corrections of the results of previous theories. Tables of these corrections are given for the resonance energy and the macroscopic-anisotropy constants. For planar anisotropy the temperature renormalization is reduced for the axial anisotropy and increased for the in-plane anisotropy.