This is the R code from my term paper, which I wrote during the first year of my master's program. It is based on the joint dataset from the World Values Survey and the European Values Survey (https://www.worldvaluessurvey.org/WVSEVSjoint2017.jsp).
Abstract: The study analyses factors influencing attitudes towards abortion using combined WVS/EVS data (2017-2022, 92 countries, N > 150,000). Based on cultural modernisation theory and the authoritarian attitudes model, the study focuses on the role of patrimonialism (loyalty to the nation, family, and state authority) as a key predictor. The results of a two-stage multilevel regression analysis confirm that high levels of patrimonialism are significantly associated with more negative attitudes toward abortion. Religiosity was found to be the strongest negative factor at the individual level, while higher education, income, and support for gender equality contribute to greater tolerance. The hypothesis that the link between patrimonialism and opposition to abortion is stronger in the most modernised countries was only partially confirmed: this effect is evident among respondents who accept abortion in certain cases, but not among radical opponents. The study contributes to the understanding of value conflicts surrounding reproductive rights in a global context.
- abortion.html — an HTML file that shows the entire process of data preprocessing and model building step by step;
- abortion_term_paper.Rmd - similar to the previous file, but in R Markdown format;
- Tables_for_present_results - this file contains R code used to generate tables for presenting results in a paper format;
- plot_average.R - R code for bilding distribution plot of key variables at the country level