Background: the aging phenomenon has an increasing trend worldwide which caused the emergence of the SA1 concept. It is believed that the SA prediction model can increase the QoL2 in the elderly by decreasing physical and mental problems and enhancing their social participation. Most previous studies noted that physical and mental disorders affected the QoL in the elderly but didn't pay much attention to the social factors in this respect. Our study aimed to build a prediction model for SA based on the physical, mental, and social factors by considering all factors affecting SA.Materials and methods: in this descriptive, applied, and retrospective study, the data of 975 related to SA and non-SA of the elderly were investigated. We used the Chi-square test at P<0.05 to determine the best factors affecting the SA. The AB3, J-48, RF4, ANN5, SVM6, BLR7, and NB8 algorithms were used for building the prediction models. To get the best model predicting the SA, we compared them using the sensitivity, specificity, accuracy, F-measure, and AUC. Results: The Chi-square test showed that 28 variables had a meaningful relationship with SA. The results of comparing the ML9 model's performance showed that the RF with sensitivity=0.91, specificity= 0.98, accuracy= 0.95, F-test=0.9, and AUC-test= 0.884 is the best model for predicting the SA. Conclusion: using prediction models can increase the QoL in the elderly and consequently reduce the economic cost for people and societies. The RF can be considered an optimal model for predicting SA in the elderly.