The study employed density functional theory (DFT) in conjunction with the generalized gradient approximation (GGA) to investigate the electronic, structural, and mechanical properties of twelve rare Earth-magnesium alloys. These alloys exhibit remarkable mechanical stability, with HoMg and ErMg displaying exceptional shear resistance and stiffness, making them promising candidates for demanding applications. Furthermore, our analysis using principal component analysis (PCA) revealed significant trends and correlations among the material properties of these alloys, offering insights into their potential industrial applications. This research not only advances our understanding of rare Earth-magnesium alloys but also contributes to the development of advanced materials in engineering and industry.