How many quit mathematics because they (are afraid that they) can not find a permanent job? I think it is an important question, which frequently appears in discussions. Do you know any surveys which approach it? What are the reasons for people with completed PhD in mathematics to quit it? Definitely, there are many reasons, but how many of them would like to do research in math, but switch to something else because of uncertainty in the future?
Anyway, what are your expectations of such a survey? I heard many estimates, from 0% to 50%.
By quitting mathematics I mean, that a person stops doing research. So, switching to finance, programming, only teaching without active research means "quitting mathematics" in most cases.
I don't know, we can define "doing mathematics" by writing at least one research article in five years or so. Or working on research positions in academia or Microsoft Research and similar. Any surveys are welcome, in any country and time period.
 A: From the AMS (American Math Society) "Report on the 2014–2015 New Doctoral Recipients"
(PDF download):




Figure from the August 2016 Notices of the AMS, p.755.


A: The question asks for data on why people leave research mathematics.  I don't have any, so in a sense I can't really answer the question.  What I have is personal experience and a reasonable number of anecdotes: I had a pretty good postdoc but I didn't even apply for tenure track positions, and a surprisingly large number of my colleagues made similar choices.
Granting the subjective nature of my experience, I would emphasize that all parameters in the naive expected payoff computation come into play, not just the probability of success:
$$\mathbb{E}(\text{Stay in math}) = \mathbb{P}(\text{Tenure}) \text{Payoff}(\text{Research}) + (1 - \mathbb{P}(\text{Tenure})) \text{Payoff}(\text{Non-Research Job})$$
My generation of math PhD's had the harrowing experience of being one of several hundred or even upwards of a thousand applicants for one or two postdocs, and it doesn't get much better for tenure track jobs.  Moreover public investment in research and postsecondary education appears more likely to decrease than increase, at least in the US.  So the probabilities are quite discouraging.
But what I want to emphasize is that the payoff for non-research jobs is quite high these days, and this is just as important for many people.  I and a solid majority of my colleagues who left research mathematics did so not for finance but for data science.  Engineering advances have left businesses in all industries with literally more data than they know what to do with, and for the time being they are convinced that it is worthwhile to hire people with strong mathematical and scientific credentials to help sort it out.  
Unlike mathematical research where it is typical to spend years working on something that only a handful of people can appreciate, a data scientist can have an impact which is recognizable to people outside of math or science in 6-12 months.  And a lot of beautiful ideas are involved - information theory, functional analysis, convex geometry, graph theory, and even a dash of topology all arise nontrivially.  The fact that there are many more openings than people to fill them is icing on the cake.
A: This is more of a suggestion than an answer, but perhaps the following objectively measurable statistic would come close to addressing the question:

The number of people in the final year of their current position who applied to at least (say) five academic positions but received no offers from academic institutions.

The first part of this description indicates some kind of desire for an academic position, while the latter part suggests an involuntary exit from the academic world.  Note that "final year" could be the final year of a Ph.D., a postdoc, or a tenure track.
Of course this does not exactly match the original question, for several reasons.


*

*It does not capture those who were (in Nikita's terminology) "afraid" that they would not get an academic position and therefore elected not to apply.

*It does not distinguish between "academic position" and "position in which one does mathematical research," neither of which implies the other.

*It does not allow for the possibility that someone works at a non-academic position for some time and then returns to an academic position later.
But it seems close.  I don't know that anyone has conducted a survey that tries to measure exactly this number, but perhaps some group that already conducts related surveys could be persuaded to add this to their existing questionnaires.
