Set up Rstudio

Setting up RMarkdown when opening it enables you to create dynamic, reproducible, and visually appealing reports, presentations, and documents, that can help you communicate your data analysis and research findings more effectively.

Set up the script to remove scientific notation

Use the command below to ensure that the output values are not written in scientific notation.

options(scipen=999)

Load necessary packages

library(ggplot2)
library(ggpubr)
library(stargazer)
library(kableExtra)
library(jtools)
library(gtsummary)
library(broom)

Import the data set

Religiosity<-read.csv("C:\\Users\\user\\Downloads\\Religiosity.csv")

Visualize the data set

head(Religiosity,20)

Attache the data set

attach(Religiosity)

Scatter Plot with a line of bestfit

ggplot(data=Religiosity, aes(x=Feel.Religious...., y=Gdp.per.capita.current.US.dollar.)) +
        geom_smooth(method="lm") +
        geom_point() +
        stat_regline_equation(label.x=60, label.y=40000)

Add a regression equation and R-square to the scatter plot

ggplot(data=Religiosity, aes(x=Feel.Religious...., y=Gdp.per.capita.current.US.dollar.)) +
        geom_smooth(method="lm") +
        geom_point() +
        stat_regline_equation(label.x=60, label.y=40444) +
        stat_cor(aes(label=..rr.label..), label.x=60, label.y=35000)+
  labs(title="A scatter Plot of Religiosity and GDP per capita
       for different countries",
       caption="Source:CEOWORLD MAGAZINE",
       y="GDP per capita in current US dollars", x="Feel Religious on a scale of 1-100",
       color=3) + # title and caption
  theme(axis.text.x = element_text(angle = 0, vjust=0.5, size = 12))

Regression Equation

My_model<-lm(Gdp.per.capita.current.US.dollar.~Feel.Religious....,data= Religiosity)

Visualize the model using stargazer

stargazer(My_model,report = "vc*stp",type = "text",out = "./q7results.txt")

=====================================================
                           Dependent variable:       
                    ---------------------------------
                    Gdp.per.capita.current.US.dollar.
-----------------------------------------------------
Feel.Religious....             -245.671***           
                                (28.650)             
                               t = -8.575            
                                p = 0.000            
                                                     
Constant                      25,959.450***          
                               (2,215.706)           
                               t = 11.716            
                                p = 0.000            
                                                     
-----------------------------------------------------
Observations                       148               
R2                                0.335              
Adjusted R2                       0.330              
Residual Std. Error       8,774.417 (df = 146)       
F Statistic              73.528*** (df = 1; 146)     
=====================================================
Note:                     *p<0.1; **p<0.05; ***p<0.01
render = 'normal_print'

Alternatively

summ(My_model,confint = TRUE, digits = 3)
Observations 148
Dependent variable Gdp.per.capita.current.US.dollar.
Type OLS linear regression
F(1,146) 73.528
0.335
Adj. R² 0.330
Est. 2.5% 97.5% t val. p
(Intercept) 25959.446 21580.446 30338.446 11.716 0.000
Feel.Religious…. -245.671 -302.293 -189.048 -8.575 0.000
Standard errors: OLS

Discussion of the Results

Past studies have found a link between the level of religious freedom or religiosity in a nation and GDP per capita. These s0074udies have found GDP per capita is higher in nations with higher levels of religious freedom or that countries with increasing levels of GDP per capita have increasing levels of religious freedom. Studies of religiosity are consistent in that countries with higher levels of religiosity have lower levels of GDP per capita. Countries that have more religious freedom suggests they also have freedom in other areas with many of these freedoms important to produce higher levels of income, while nations that have the higher level of religiosity are willing to sacrifice higher levels of GDP per capita to be able to practice their religion. Along with the multiple measures of religiosity and religious freedom considered, additional variables were included to isolate their relationship with GDP per capita. Additional control variables not related to the religion variables included economic freedom, civil liberties, political rights, and percent of GDP from natural resources. Many of the measures of religious freedom and religiosity were similar to the results from previous studies or were insignificant. Consistent with the previous study the results showed that increased levels of religiosity in a nation were related to lower levels of GDP per capita. In consistent with previous studies this study found that having a state religion had a moderate relationship with GDP per capita. From the results above, religiosity was to have a negative effect on GDP per capital. From the results above, coefficient of religiosity was found to be statistically significant indicating a negative effect on GDP per capita with a p-value of less 0.01. The effect of religiosity was found to be significant at 1% level of significant.

Additional Models (GDP per capita on Life Expectancy)

Effect of GDP Per capita on Life Expectancy

All countries, rich and poor, make efforts to improve the health of their populations. Not at the same rates or with the same success, but most attempt to reduce mortality and increase health (Girosi & King, 2007). Mortality analyses are of widespread interest among academics, policymakers, medical researchers, and others in order to direct the flow of funds in the most effective way possible to the population groups in most need. Mortality forecasts are of great importance in providing policy-relevant information, and therefore, governments making institutional arrangements for retirement and health care should be aware of the actual prospects of cohorts survival (Shkolnikov, Jdanov, Andreev, & Vaupel, 2011).The dynamics of population will continue being one of the most important and overwhelming factors in the society and economy of any country and region. The understanding and analyzing of current demographic trends and their expected results and consequences are useful in order to reach the desired socioeconomic consequences. At macro level, the maintaining, expanding, and improving the health of human populations are considered as one of the key policies for sustainable development (Bayati, Akbarian, & Kavosi, 2013). Due to the fact that the crude death rate is not a precise indicator of the mortality level or of the health conditions and living standards in a country, international publications and researchers nowadays regularly make use of life expectancy at birth in the analysis and the description of the level of mortality. Life expectancy at birth is a widely used summary indicator to describe population health along with longevity (Rabbi Fazle, 2013). Life expectancy is a convenient and important summary measure of mortality and more intuitive than mortality rates (Klenk, Rapp, Büchele, Keil, & Weiland, 2007). Thus, life expectancy at birth as a measure of mortality is a valid and important indicator of population’s health status. Life expectancy at birth is used as a proxy of population health, and although health is a multi-dimensional concept, life expectancy is one of the most widely used indicators of population health (Sharma, 2018). Bilas, Franc, and Bošnjak (2014) state also that life expectancy is an important synthetic indicator for assessing economic and social development of a country or a region. Thus, according to them, defining good health implies to several socioeconomic preconditions such as reduction of poor education level, reduction of unemployment and insecurity, and improvement of life conditions.

In addition, life expectancy at birth reflects the overall mortality level of a population and summarizes the mortality pattern that prevails across all age groups—children and adolescents, adults, and the elderly (World Health Organization, 2014). The life expectancy is the integrated survivorship of the population across all ages (Missov, 2013). It is worth mentioning the showing of the difference between period and cohort life expectancy defined by Shkolnikov et al. (2011, p. 419): “While conventional (period) life expectancy is a synthetic statistic that can be interpreted as a measure of the average level of the hazard of death in a given calendar year, cohort life expectancy reflects the actual survival experiences of people born in a specific calendar year.” Furthermore, also, Missov and Németh (2016) make a contribution to better understanding of life expectany with their finding that aggregate mortality measures like life expectancy, life disparity, entropy, and the Gini coefficient are only slightly sensitive to model misspecification, and therefore, according to them, fitting any model of the Gompertz family is sufficient to model these measures.Footnote1 Life expectancy has improved substantially in the last few decades, as attention to health concerns and reduction of infant and child mortality have increased the average length of life (Mirkin, 2005). Despite these improvements, views concerning mortality among governments in developing countries have changed little. It is therefore not surprising that governments’ views of the country’s mortality level differ according to development level. As regards child mortality, after rapid improvements observed before 1990, a stagnation in progress has been recorded in the 1990s. Lack of progress in achieving health objectives, e.g., those citied in the Programme of Action and Millennium Development Goals, as Mirkin (2005) explains, may be as much due to wide inequalities within countries—wealthy and poor populations, urban and rural, male and female, as to inequalities between countries. Indeed, this attention in policy circles has substantially risen sharply with the adoption of the Millennium Development Goals (MDGs) that have set clear targets for many indicators of well-being, including health well-being indicators such as infant mortality rate (IMR) (Cornia & Menchini, 2006). Concern for reducing inequality in health was evident also in the WHO “Health for All” strategy and with its related target in 1984 that by the year 2000, the actual differences in health status between countries and between groups within countries should be reduced by at least 25% (ibid).

The scope of the research paper is to link the key parameters of socioeconomic development with mortality prospects. Thus, this paper particularly investigates the relationship between socioeconomic development represented through GDP per capita and infant mortality rate as its background variables and life expectancy at birth, as an indicator of mortality or longevity and as a dependent variable. Indeed, European countries differ in many respects, in, e.g., new member states of the EU versus old member states and candidate states or according to different welfare regimes. Why these five countries were chosen? First, these five countries are EU accession candidate countries (European Commission, 2019). All of these countries are within the Balkan region. Thus, the paper considers a unique framework to support cross-national comparisons with regard to LE and socioeconomic development within these countries. Second, our research results also include analyses of the magnitude of differences measured across countries and even the results may be compared with the ones of current EU countries. In addition, we expect that the research will provide insights that will contribute in a number of ways in enriching extant demographic literature. Third, given the relatively absence of cross-nationally comparative analyses or generally rather old demographic literature reviews on some parts of the Balkan region, it is expected that this research will supplement the findings with data and analyses on a demographic research issues, specifically related with this region. It includes mortality or longevity prospects, the level of development and progressive changes that occur in life expectancy in relation to the socioeconomic development, and demographic evidence for comparable purposes, since we know that the pursuit of health and longevity are among the fundamental pillars of development. The paper is organized as follows: section 2 is about theoretical and hypotheses framework as well as for variables background, section 3 is about the country’s comparisons in mortality and their socioeconomic specifics, section 4 presents the data and methods, section 5 contains the application of FIML method and provides the main research results, and we conclude in section 6.

Theoretical framework and variables background

In the first subsection (“Theoretical framework and major hypotheses”), we briefly introduce the theoretical and hypotheses framework and further the theoretical focus was directed towards its roots i.e., demographic transition process. After this part a wider theoretical and hypotheses review of literature was provided in this subsection. In the second subsection (“Variable background”) the following background variables: GDP per capita and infant mortality rate have been included. This subsection presents further details about these variables and their relationship with life expectancy at birth as a dependent variable.

Theoretical framework and major hypotheses

The assumptions based on both theoretical and empirical results suggest that the expected changes in the life expectancy at birth as an indicator for past, present, and future dynamics of mortality levels primarily were and will be under significant influence of the changes in the socioeconomic development in these countries and especially with improving of the living standard and health conditions of their people. In this regard, Shkolnikov et al. (2011, p. 428) specified that “The prolongation of life into old and oldest-old ages changes the traditional balance between the different stages of the life cycle and has large-scale socioeconomic consequences that may be addressed in different ways.” The current study is conducted to check whether socioeconomic development through its background variables (GDP per capita and infant mortality rate) have applicable effect on life expectancy at birth. Based on data and methodology that will be explained in section 4 the validity of our hypotheses framework will be tested. The hypotheses framework leads to a relevant research points and debates that will be discussed consequently in this section.

Income influences the condition of people’s lives and is a main socioeconomic determinant of health (Bayati et al., 2013). Several studies considered income as one of the main determinants of health (ibid). The national living standards had a direct and positive impact on the demographic changes (direct effect of income on mortality or to the life expectancy). A higher living standard raises consumption aspirations and fosters the growth and the development. The national level of economic development operates on the nation’s demographic change via the intermediate variables as mortality and life expectancy at birth, i.e., increasing longevity and improving the life expectancy of all ages and reducing the mortality risks in all age groups. Chamie (2005) pointed out that a further mortality declines also appear likely with increased concerns and changes with respect to life style, nutrition, and advances in medical technology.

The rich/poor divide is well known to demographers. It brings us back to familiar patterns that are observed in demographic phenomena and where the theory of the “second demographic transition” explains the processes. Societies where the structural process is in a later phase generate less economic growth and development. But the timing of the decline in infant mortality is also linked to a broader issue, a crucial one in the theoretical literature on the relation between life expectancy and GDP: the first demographic transition (Felice, Andreu, & Ippoliti, 2016). In economics, the unified growth theory holds that the demographic transition plays a crucial role in initiating the shift from stagnation to growth (Felice et al., 2016, p. 814): “The idea is that with the demographic transition, higher life expectancy leads to lower fertility and lower population growth, and thus to higher returns of human capital investments to those living longer.” In turn, lower fertility and higher human capital both contribute to the rise of GDP per capita. However, the roots for the hypothetical framework bring us again back to the process of the first demographic transition. Typically, during the intermediate phase of the demographic transition when the fertility rate starts to fall, there are fewer dependent children who have to be supported. In that period, the number of working age people grows relatively faster than the number of children and the share of old dependent people has not yet increased. As Mason and Lee (2012) have explained the concept of second demographic dividend and its connections with a low fertility as a demographic factor; however, they have underlined that steady and continuing improvement in adult mortality are also important, as is the rising proportion of the population at the older ages. Thus, during this phase, more resources for investment in economic development and family welfare are available, and with all other things being equal, per capita income grows faster. Among a number of potential factors, the focus of the research is on the role of GDP per capita. In the long run, the trend in economic growth, as measured by GDP per capita, is very likely to be associated with the trend in mortality reduction, which is the main component captured by many of the stochastic mortality models.

One of the earlier benchmark studies of the income-health relationship is Preston (1975) who compared different countries’ life expectancy and per capita income for different benchmark years (1900, 1930, and 1960) and proposed the “Preston curve” a non-linear and concave empirical relationship between the two (Stengos, Thompson, & Wu, 2008, p. 4). The concave Preston curve has provided the rationale for much of the empirical work that has followed. However, according to Stengos et al. (2008), simple health-per capita income relationships may suffer from endogeneity, especially when it comes to countries on the flat portion of the Preston curve, where health has reached such an advanced stage where additional improvements coming from income growth cannot be attained. In that case, it would be the reverse impact from health to income that would be important. Worldwide data on life expectancy does appear to be strongly correlated with economic development and employment. Improvements in economic conditions are an important force behind mortality decline. Sickles and Taubman (1997) showed evidence that life expectancy increases as a country improves its standard of living. Reviewing the theoretical focus and empirical work of Preston in 1976 on this topic, Sickles and Taubman (1997) showed that the data strongly suggest that longevity is an economic good, evidence that life expectancy increases as a country improves its standard of living long has been recognized since the higher income typically associated with development makes possible in part the consumption of goods and services that improve health. A number of cross-country studies have found a positive effect of life expectancy, or a negative effect of mortality on income per capita, but the debate is still ongoing. The relationship between health and GDP for 13 Organization for Economic Cooperation and Development (OECD) countries over the last two centuries revealed that GDP per capita and total GDP have a significant impact on life expectancy for most countries (Niu & Melenberg, 2013), and therefore, it was followed by lower mortality rates. A causal explanation of the dynamics by age and cohort effects and socioeconomic conditions might be a promising line of mortality research. As a good example, Ediev (2011) pointed out the longevity in the eastern European countries. The sudden change of socioeconomic conditions in the former Eastern Block countries that joined the European Union slowed down health deterioration in those countries and extended exposure durations to lower mortality levels. According to Ediev (2011), this was promptly reflected by the convergence of these countries to the western European trends.

In their study of the low-mortality population comprised of 132 countries from Europe, North America, most of Oceania and Latin America, large parts of Asia (excluding the high mortality area in Central and Southern Asia), as well as Northern Africa, Caselli et al. (2013), revealed strong correlation between life expectancy and the level of economic development for both sexes. Regardless of the diversity of these countries in various aspects, including medical standards, access to health care, and behavioral risk factors such as the prevalence of smoking, these differences were strongly related to economic development and contributed to wide variation in life expectancy levels. These authors emphasized that the economic stagnation or an economic crisis could have a stagnating effect on life expectancy, especially if there is an increase in the number of people without significant resources. Another issue that Caselli et al. (2013) found in their study was the universal availability of the European health systems, which according to them do not have the means to function as desired. Furthermore, they pointed out that in Eastern Europe people would also have to decrease their alcohol consumption and countries in this region would have to improve their health care systems. However, it is interesting for our research that as countries with low mortality from Eastern Europe in their study besides Bulgaria, Czech Republic, Romania, Russian Federation, and Ukraine, they included Serbia and Macedonia as well. In some other study, Caselli, Drefahl, Siegmundt, and Luy (2014) found that the impact of socioeconomic status on mortality is not just an issue of an individual’s performance within the network of factors. These authors claim that the societal, political, and disease environment in which an individual lives is also important and could explain why socioeconomic status has different effects in different populations at different times. According to them, economic stagnation or economic crises could have a similar effect, especially if there is an increase in the number of people without significant resources.

Variables background

The use of real GDP per capita as a measure of economic development is widely documented (e.g., Ediev, 2011; Stengos et al., 2008; Wolpin, 1997). First, GDP per capita is relatively objective and easy to access, making the model more transparent. Second, the dynamics of the GDP per capita has been widely studied in the literature. Yet, there is a generally accepted measure for standard of living that economists refer to as the average real gross domestic product (GDP) per capita (Mpofu, 2013). Moreover, the trend in GDP per capita may capture the trend in the overall economy. It seems that the GDP per capita for our period of study may be a proxy of both purchasing powers during this period and of the level of economic development (Wolpin, 1997). In some cases, as with income, it is easy to demonstrate the consequence of including a proxy because income is an explicit component of the optimizing framework. The importance of income per capita on life expectancy has awakened interest over the years to both policy makers and economists. Avdeev et al. (2011) pointed out that the standard of living and economic potential of countries are reflected in gross national income per capita. It seems that the better economic position and the higher expenditures on health contributed positively to maintaining lower mortality levels. A large body of research has found strong links between GDP and actual mortality (e.g., Cutler, Deaton, & Llieres-Muney, 2006; Mpofu, 2013; Stengos et al., 2008). A well-established causal link goes from income to longevity. Many researchers argue that development should focus on income growth, since higher incomes indirectly lead to health improvements. The rapid health improvements over the last 40 years raise the question of the driving forces behind this trend. Most of the empirical studies, for example, assume that health improvements are the by-product of higher income as countries with higher income devote more resources for their health services, something that would translate into improved health status for their population (Stengos et al., 2008). The 20 ranked countries in the world measured by Human Development Index (HDI) show that countries with high quality of life and Life Expectancy Index have a high GDP per capita, i.e., higher ranked countries on the HDI generally display higher life expectancy, implying better health, and higher GDP per capita (Mpofu, 2013). Positive changes in mortality that have been observed in the former USSR from the middle of the 1960s were the results of economic growth and industrialization, but mortality levels were also influenced by various negative consequences of the industrial revolution (Andreev, Biryukov, & Shaburov, 1994). The mortality changes during 1992–1994 and 1995–1996 in Russia were connected with the implementation of the Russian social and economic reforms and with subsequently adaptation of their population to a large-scale political and economic stresses (Shkolnikov, Cornia, Leon, & Meslé, 1998; Shkolnikov, McKee, & Leon, 2001).

Analyzing the results from the Preston’s article (1975) about life expectancy versus GDP per capita, Cutler et al. (2006) pointed that life expectancy is profoundly lower for countries with lower levels of per capita income and that there was also a positive relationship between income and health within countries—low-income people live shorter lives than high-income people in a given country. Through the twentieth century in the USA and other high-income countries, growth in real incomes was accompanied by a historically unprecedented decline in mortality rates that caused life expectancy at birth to grow by nearly 30 years (ibid, pp. 97). Accordingly, improvements in life expectancy in the USA have been matched by similar improvements in other rich countries. Lutz and Kebede (2018) do not question the basic assumption that income growth and health are closely linked. Their multivariate results from a balanced panel of 174 countries (both developed and developing) over the period 1970–2010 in 5-year intervals strongly confirmed what their analysis suggested: raising educational attainment was even stronger driver of increasing life expectancy and falling child mortality than income.

The other background variable, aside from income, infant mortality rate, is important to reflect children’s well-being and socioeconomic development (United Nations, 2017). Pozzi and Fariñas (2015) emphasized that the traditional use of infant mortality as an indicator of development and modernization acquires greater relevance if it is used together with child mortality, taking into account the socioeconomic determinants affecting the child mortality. In the advanced stages of the first demographic transition, there are not much room for child mortality to further decline substantially, and as a consequence, more people survive to adult and old ages. The infant mortality rate (IMR), defined as the number of deaths in children under 1 year of age per 1 000 live births in the same year, has in the past been regarded as a highly sensitive (proxy) measure of population health. According to Baker and Fugh-Berman (2009), infant mortality is the single most important determinant of life expectancy. They further point that because life expectancy is calculated as an average; hence, death rates in younger age groups have the greatest impact and that the disparities in IMRs could account for most differences in longevity. As Rabbi Fazle (2013) also discussed, high infant and child mortality rates result in lower values of life expectancy at birth than at older ages. This imbalance in life table according to him disappears only when the crossover occurs and happens when the inverse of the infant mortality becomes equal to the life expectancy at age 1.

The doubling of life expectancy seen over the last 150 years provides one of the most remarkable insights for the human population rise. Initial gains in life expectancy came from reductions in infant mortality and young adult mortality, whereas since the 1950s progress has been driven by survival improvement at older ages (Barthold Jones, Lenart, & Baudisch, 2018). Using Siler model, these authors have shown that gains in life expectancy through either bringing down infant mortality or decreasing the level of senescent mortality inevitably result in an increase in the proportion of life share. The compelling evidence and work of Barthold Jones et al. (2018) from the last decades showed that a survival improvement among the elderly has been propelled by the onset of senescent mortality being postponed. Explaining a study with a Siler model with two different (constant) rates of mortality decline: one for infant and one for non-infant mortality, Missov and Lenart (2011) came to conclusion that Siler model converges with time to mortality schedule of population described on a period basis as levels of and improvements in infant mortality become negligibly small. In addition, Shkolnikov et al. (1998) noticed that the steep growth of life expectancy in 1985–1987 and its fall in 1988–1994 for Russian population and the variation in death rates over the period among children and the elderly had very limited influence on changes in life expectancy at birth in Russia.

However, infant mortality and life expectancy trends are obviously unequally distributed globally. Hence, it seems that the life expectancy and infant survival are both often better in the developed countries, as compared to that of the developing countries or within the less developed countries. The link between infant mortality and life expectancy, and the tendency for less developed countries to have higher level of infant mortality and lower life expectancy at birth, is one of the key explanations for the socioeconomic inequalities that exist across these countries. This study demonstrates that socioeconomic inequalities and/or development matter for mortality and life expectancy. Child survival is highly correlated with the level of development (United Nations, 2017). This reflects the apparent association between the causes of infant mortality and other factors that are likely to influence the health status of whole populations such as their economic development, general living conditions, social well-being, rates of illness, and the quality of the environment (Reidpath & Allotey, 2003). Due to technological advancement, reduced maternal and child mortality, and improved health care delivery system, people from most of the countries can enjoy high survival chances (Zaman, Hossain, Mehta, Sharmin, & Mahmood, 2017). Thus, in our research, we use the infant mortality variable as an indicator for the overall development and health of the population, including its longevity or life expectancy.

Cornia and Menchini (2006) clarify that the measurement of average well-being and of its distribution among the population, as well as cross-country comparisons, faces fewer methodological problems and does not require the adoption of arbitrary hypotheses and statistical conventions. In the same way, the definition and meaning of the variables used—infant mortality rate and life expectancy at birth, according to them, are less ambiguous than that of monetary aggregates. The use of life expectancy at birth as an indicator of health well-being faces additional problems of interpretation because such an indicator is in fact computed on the basis of the age-specific mortality rates observed for different cohorts at a moment in time. However, Cornia and Menchini (2006) noted that such rates do not reflect the real life chances of a person born in the reference year, as computation of such index would require to know the future risks of death at different ages for a person. In this regard, Glasen (2015, p. 5) defines life expectancy at birth measured in years as the average “number of years a newborn infant would live if prevailing patterns of mortality at the time of its birth were to stay the same throughout its life” over the whole population of each individual country. Consequently, life expectancy at birth does not refer to any individual birth cohort but rather to a hypothetical cohort facing the age-specific death rates observed at the present time. In analyzing changes in infant mortality rate, life expectancy at birth, and life expectancy at age 1, Cornia and Menchini (2006) emphasized that progress continued without interruptions for all these indicators for both developing and developed countries, but they did not assess whether these gains achieved with a similar, faster or slower pace than in the past.

Countries comparison: socioeconomic and life expectancy specifics The mentioned EU accession candidate countries (Macedonia, Montenegro, Serbia, Albania, and Bosnia and Herzegovina)Footnote2 are all within the Balkan region, and there are common facets among them with respect to key institutional features and economic patterns (see, Eurostat, the statistical office of the European Union, 2019; European Commission, 2019). The five countries belong in the group of middle-income countries. These countries previously experienced a strong decrease in infant mortality, rising living standard, and better education, as well as advance in healthcare and medicine. All these influenced their mode of life and indirectly their health and the length of life. The key element in former Yugoslavia after World War II was the control of the socialism. A key goal of the socialist program was a transformation of the economy and society through intensive industrialization that would rapidly bring economic productivity, education, health, and equality in the region up to and even beyond (Arland & Philipov, 2007). The countries of former Yugoslavia and Central and Eastern Europe as well had considerable success in industrialization, increasing education, reducing mortality, and producing equality (ibid, pp. 25). There are some differences in terms of the economic and social situation between the five countries, which appear to be somehow related to their different levels of socioeconomic development and its demographic patterns, but the differences are not so large.

As can be seen from Fig. 1 the gross domestic income per capita in 2006 (based on US\() was US\) 2913 in Albania, US$ 3326 in Macedonia, US$ 3404 in Bosnia and Herzegovina, and then just a little more in Serbia, US$ 4130, and the highest level was noticed in Montengro with US$ 4405 (UN, 2018). Montenegro has also the highest level of GDP per capita in 2017 in comparison with the rest of four countries.Footnote3 In all five countries, demographic behavior is thus relatively similar despite their socioeconomic differences. This is an important point, since Sebti, Courbage, Festy, and Kursac-Souali (2009) have proved also that the living standards and educational levels are classic determinants of demographic trends, with improvements in economic and cultural conditions generally being associated with progress in the first demographic transition. The future mortality trends of the five countries will be driven mainly by mortality in adult ages, primarily the old and oldest-old. However, additional gains in life expectancy are possible owing to further reductions of mortality at these older ages. A decomposition analysis of life expectancy into specific age groups showed that gains in life expectancy in western European countries came from older age groups as compared to the majority of former socialist countries (Čipin, Smolić, & Medžimurec, 2017). Therefore, it is expected (with reference to past trends) that a further extension of life expectancy at birth in all these five countries would be achieved through a decrease in mortality among the oldest old group of the population.

Testing the assumptions of Classical Linear Regression Model

Data visualization

Scatter Plot (GDP per capita and Life Expectancy)

ggplot(data=Religiosity, aes(x=Gdp.per.capita.current.US.dollar., y=Life.expectancy)) +
        geom_point()+
  labs(title="A scatter Plot of Life Expectancy and GDP per capita
       for different countries",
       caption="Source:CEOWORLD MAGAZINE",
       y="Life Expectancy", x="GDP per capita")

Log Linear the Independent variable

ggplot(data=Religiosity, aes(x=log(Gdp.per.capita.current.US.dollar.), y=Life.expectancy)) +
        geom_point()+
  labs(title="A scatter Plot of Life Expectancy and GDP per capita
       for different countries",
       caption="Source:CEOWORLD MAGAZINE",
       y="Life Expectancy", x="GDP per capita")

Add the line of best fit and R-square to the scatter plot

ggplot(data=Religiosity, aes(x=log(Gdp.per.capita.current.US.dollar.), y=Life.expectancy)) +
  geom_smooth(method="lm") +
        geom_point() +
        stat_regline_equation(label.x=10, label.y=50) +
        stat_cor(aes(label=..rr.label..), label.x=10, label.y=4)+
  labs(title="A scatter Plot of Life Expectancy and GDP per capita
       for different countries",
       caption="Source:CEOWORLD MAGAZINE",
       y="Life Expectancy", x="GDP per capita")

Histogram

hist(Gdp.per.capita.current.US.dollar.,breaks = 20, main = "Histogram for the distribution of GDP per capita")

Log Linear the independent variable

hist(log(Gdp.per.capita.current.US.dollar.),breaks = 25, main = "Histogram for the distribution of GDP per capita")

Regress GDP per capita on Life expectancy

Statistical techniques are tools that enable us to answer questions about possible patterns in empirical data. It is not surprising, then, to learn that many important techniques of statistical analysis were developed by scientists who were interested in answering very specific empirical questions. So it was with regression analysis. The history of this particular statistical technique can be traced back to late nineteenth century England and the pursuits of a gentleman scientist, Francis Galton. Galton was born into a wealthy family that produced more than its share of geniuses; he and Charles Darwin, the famous biologist, were first cousins. During his lifetime, Galton studied everything from fingerprint classification to meteorology, but he gained widespread recognition primarily for his work on inheritance. His most important insight came to him while he was studying the inheritance of one of the most obvious of all human characteristics: height. In order to understand how the characteristic of height was passed from one generation to the next, Galton collected data on the heights of individuals and the heights of their parents. After constructing frequency tables that classified these individuals both by their height and by the average height of their parents, Galton came to the unremarkable conclusion that tall people usually had tall parents and short people usually had short parents. In other words, he found that one could predict, with some accuracy, the heights of individuals from the heights of their parents. The data on which he based his conclusions are presented, in a highly condensed form, in Table 1.1

knitr::include_graphics("Regression.png")
Frequency distribution of individual height

Frequency distribution of individual height

However, after studying these data in greater detail, Galton came to another, more remarkable, conclusion. Individuals who had tall parents were often taller than average, but they were usually not as tall as their parents. Conversely, individuals who had short parents were often shorter than average, but they too were usually not as short as their parents. Galton termed this pattern of inheritance “regression to the mean.” By that, he meant that parents who were far from average on any characteristic, such as height, often had children who were closer to the average on that characteristic. In proposing his principle of the regression to the mean, Galton had not only discovered an important principle of genetics, he had also identified, quite inadvertently, two concepts that would become very important to the burgeoning field of statistics. The first concept had to do with developing a method for predicting the values of one quantitative variable, such as the heights of individuals, using the values of another quantitative variable, such as the heights of their parents. For example, even though there was some regression to the mean, the heights of individuals were related, in a general way, to the heights of their parents. Galton realized that it should be possible to develop a mathematical function to describe such a relationship between two quantitative variables. The second concept had to do with developing a method for assessing the lawfulness or regularity of any such relationship.

## Import your data

reg_dat <- read.csv("C:\\Users\\user\\Downloads\\Religiosity.csv")
attach(reg_dat)
### View the first few observations
head(reg_dat,5)
render = 'normal_print'
### Estimate the model
reg_model <- lm(Life.expectancy~Gdp.per.capita.current.US.dollar.,data = reg_dat)

Visualize the model using stargazer

stargazer(reg_model,report = "vc*stp",type = "text",out = "./q7results.txt")

=============================================================
                                      Dependent variable:    
                                  ---------------------------
                                        Life.expectancy      
-------------------------------------------------------------
Gdp.per.capita.current.US.dollar.          0.001***          
                                           (0.0001)          
                                           t = 9.942         
                                           p = 0.000         
                                                             
Constant                                   59.884***         
                                            (0.786)          
                                          t = 76.177         
                                           p = 0.000         
                                                             
-------------------------------------------------------------
Observations                                  148            
R2                                           0.404           
Adjusted R2                                  0.400           
Residual Std. Error                    7.658 (df = 146)      
F Statistic                         98.850*** (df = 1; 146)  
=============================================================
Note:                             *p<0.1; **p<0.05; ***p<0.01

Alternative way to display the results

summ(reg_model,confint = TRUE, digits = 3)
Observations 148
Dependent variable Life.expectancy
Type OLS linear regression
F(1,146) 98.850
0.404
Adj. R² 0.400
Est. 2.5% 97.5% t val. p
(Intercept) 59.884 58.330 61.437 76.177 0.000
Gdp.per.capita.current.US.dollar. 0.001 0.000 0.001 9.942 0.000
Standard errors: OLS

This is a regression output that shows the relationship between life expectancy and GDP per capita in current US dollars. The regression suggests that there is a positive and statistically significant relationship between the two variables. Specifically, for every one-unit increase in GDP per capita, life expectancy is estimated to increase by 0.001 years. This coefficient is statistically significant at the 1% level, indicating that it is highly unlikely to have occurred by chance.

The constant term represents the predicted value of life expectancy when GDP per capita is zero, which is estimated to be 59.884 years. This constant is also statistically significant at the 1% level, indicating that there are other factors besides GDP per capita that influence life expectancy. On the other hand, the R-squared value of 0.404 indicates that approximately 40% of the variation in life expectancy can be explained by GDP per capita. The adjusted R-squared value of 0.400 suggests that the model provides a good fit to the data, but there may be other variables that could improve the model’s explanatory power.

The residual standard error of 7.658 indicates the average distance between the observed values of life expectancy and the predicted values based on the model. The F-statistic of 98.850 with a p-value of 0.000 indicates that the model is statistically significant and that the regression coefficients are unlikely to have occurred by chance.

Model Diagnostic

Testing for Causality (to be continued)