The interest in studies aimed at understanding the integration of the stock market with the economic performance of countries has been growing in recent years, perhaps driven by the recent economic crises faced by the world. Although several studies on the topic have been carried out, the results are still far from a meaningful conclusion. In this sense, this paper considered the dual objective of investigating whether there is significant variance in the economic performance of developed and emerging markets’ countries and whether the global risk factors are statistically significant in explaining the variations in their future economic performance over time. From a sample of (i) gross domestic products from BRICS and G7 countries (total of twelve countries), and (ii) returns of the risk factors of developed and emerging stock markets for the period 1993 to 2019, we applied longitudinal regression modeling for five distinct percentiles, and random coefficients modeling (RCM) with repeated measures. We found that risk factors explain the future economic performance, there is significant variation in economic performance over time among countries, and the temporal variation in the random effects of intercepts can be explained by RCM. The results of this study confirm that stock markets follow an integration process and that moderately integrated markets may have the same risk factors. Furthermore, considering that risk factors are related to future GDP growth, they act as proxies for unidentified state variables.