The correlation is not necessarily causal, though. Economic prosperity is correlated with less external threat. If you aren’t constantly under threat of invasion, you tend to become more prosperous. This may seem like a nit picky distinction, but it’s an important one. If the cause of the population’s desire to legislate weapons is based on perceived threat level, rather than economic factors, than it becomes more unpredictably variable, and can lead to unintended consequences such as a black market for weaponry. The consequences of such a black market could be disasterous, similar to the market for narcotics.