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 〈Olm〉. 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 ΔM(T) and the parameter b(T), which characterizes the nonsphericity of the moment precession. Significant deviations from the classical 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μB and 0.08μB, respectively, and the ratio [b(T)-b(0)]/[ΔM(T)-ΔM(0)] is approximately 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.