  We report the effects of lattice dynamics on thermodynamic stability of
binary $R_{1-x}$Fe$_x$ $(0<x<1)$ compounds ($R$: rare-earth elements, Y, Ce,
Nd, Sm, and Dy) at finite temperature predicted by first-principles calculation
based on density functional theory (DFT). We first demonstrate that the
thermodynamic stability of $R_{1-x}$Fe$_x$ $(0<x<1)$ alloys cannot be predicted
accurately by the conventional approach, where only the static DFT energy at $T
= 0$ K is used. This issue can be overcome by considering the entropy
contribution, including electronic and vibrational free energies, and we
obtained convex hull plots at finite temperatures that successfully explain the
thermodynamic stability of various known compounds. Our systematic calculation
indicates that vibrational entropy helps stabilize various $R_{1-x}$Fe$_x$
compounds with increasing temperature. In particular, experimentally reported
$R_2$Fe$_{17}$ compounds are predicted to become thermodynamically stable above
$\sim$800 K. We also show that thermodynamic stability is rare-earth dependent
and discuss its origin. Besides the experimentally reported structures, the
stability of two new monoclinic $R$Fe$_{12}$ structures found by Ishikawa
\textit{et al.} [Phys. Rev. Mater.~\textbf{4}, 104408 (2020)] based on a
genetic algorithm are investigated. These monoclinic phases are found to be
dynamically stable and have larger magnetization than the ThMn$_{12}$-type
$R$Fe$_{12}$. Although they are thermodynamically unstable, the formation
energies decrease significantly with increasing temperature, indicating the
possibility of synthesizing these compounds at high temperatures.
