Nobody is sure about the connections between sex and prostate cancer. The article suggests that after age 50, masturbation is good.
Anyway, the article referenced in that link from the British Journal of Urology is not available for review without paying a fee. I did read the abstract and noted two important things: first, it seemed to be a retrospective self-reported recollection from older men trying to remember how often they had sex or masturbated since they were 20 years old; and second, there were only 400 men involved in each group.
The result SUGGESTED that men who were diagnosed with prostate cancer later in life reported a higher than average frequency of masturbation in their 20's and 30's than men who did not. Also, men who did not develop prostate cancer in their old age reported a higher than average frequency of masturbation when they were in their 50's or later, but a lower than average amount when they were younger. Sex with a partner at any age did not seem to correlate with either an increased risk or a decreased risk.
I think this makes perfect sense from a teleological standpoint. Any organ or body system that stays stimulated and actively producing new cells runs a statistically higher chance of making a mistake in transcribing DNA and going rogue down the road at some point.
Anyway, the details of the study aren't available unless you want to pay, so all the little questions like what they define as "more than average" frequency of masturbation and other things like that aren't readily available unless you shell out the money now or just wait a few months when they allow you to download the article for free.
_________________________
--Some of us look for The Way in opium and some in God, some of us in whiskey and some in love. It is all the same Way and it leads nowhither.