Cosgrove et al reported a higher rate of sexual dysfunction in veterans with posttraumatic stress disorder (PTSD) than in veterans who did not develop this problem.  The domains on the International Index of Erectile Function (IIEF) questionnaire that demonstrated the most change included overall sexual satisfaction and erectile function. [43, 44] Men with PTSD should be evaluated and treated if they have sexual dysfunction.
Depression and anxiety: Psychological factors may be responsible for erectile dysfunction. These factors include stress, anxiety, guilt, depression, widower syndrome, low self-esteem, posttraumatic stress disorder, and fear of sexual failure (performance anxiety). It is also worth noting that many medications used for treatment of depression and other psychiatric disorders may cause erectile dysfunction or ejaculatory problems.
Erection dissatisfaction can actually enhance lovemaking. The dark cloud of erection changes has a silver lining. Young couples often have problems because young men become aroused faster than young women. Young men are often all finished before young women have even started to get aroused. Post-50 erection changes slow men’s arousal process so their erotic pace more closely matches women’s. A slower pace allows plenty time for kissing, cuddling, and whole-body massage, all essential to most women’s enjoyment of sex. Seen in this light, for many older couples, erection dissatisfaction can be a gift.
A rigid or nearly rigid erectile response to intracavernous injection of pharmacologic test doses of a vasodilating agent (see below) indicates adequate arterial and veno-occlusive function. This suggests that the patient may be a suitable candidate for a trial of penile injection therapy. Genital stimulation may be of use in increasing the erectile response in this setting. This diagnostic technique also may be used to differentiate a vascular from a primarily neuropathic or psychogenic etiology. Patients who have an inadequate response to intracavernous pharmacologic injection may be candidates for further vascular testing. It should be recognized, however, that failure to respond adequately may not indicate vascular insufficiency but can be caused by patient anxiety or discomfort. The number of patients who may benefit from more extensive vascular testing is small, but includes young men with a history of significant perineal or pelvic trauma, who may have anatomic arterial blockage (either alone or with neurologic deficit) to account for erectile dysfunction.
I think that a very powerful argument to young men who want to perform at the highest level is to point out the destructive nature of what they’re doing. If they’re having 18 drinks per week, if they’re having three, four, five drinks at any one time, they’re going to guarantee that their erections are not going to be at the highest level. I can’t tell you the number of men who come in saying, they went out, they had a date, they had a big dinner– which, by the way, is also not a great thing for erections, because all the blood is now going to your gut instead of to the genital area. And how important lifestyle changes are to improving your performance, as well, if not better, than the medications. So make certain that you exercise modestly, not excessively. Make certain that you have a smaller meal on an evening or a day that you want to have a sexual encounter, because you want the blood to go, once again, to the penile area and not to your gut. And really, the whole idea of stress– if you’re stressed out, if you’re worried about a lot of things, if you’re distracted, you can’t initiate that psychic stimulus to your spinal cord and then ultimately to your penis. So stress management is incredibly important.
However, a review of a United Kingdom medical record database found no evidence that the use of 5-alpha reductase inhibitors independently increase the risk for ED. In 71,849 men with benign prostatic hyperplasia (BPH), the risk of ED was not increased with the use of finasteride or dutasteride only (odds ratio [OR] 0.94), or a 5-alpha reductase inhibitor plus an alpha blocker (OR 0.92) compared with an alpha blocker only. In addition, the risk of ED was not increase in 12 346 men prescribed finasteride 1 mg for alopecia, compared with unexposed men with alopecia (OR 0.95). The risk of ED did increase with longer duration of BPH, regardless of drug exposure. 
A common and important cause of ED is vasculogenic. Many men with ED have comorbid conditions such as hyperlipidemia, hypercholesterolemia, tobacco abuse, diabetes mellitus, or coronary artery disease (CAD).  The Princeton III Consensus recommends screening men who present with ED for cardiovascular risk factors; ED may be the earliest presentation of atherosclerosis and vascular disease. 
Me? I'm in my 60's and never had ED, not even once. And never failed to have a good orgasm with sexual activity. Unfortunately, I think it has created too much of a contrast to my wife, who has never had an orgasm, and now in menopause has given up and won't even let me touch her sexually (hugging and kissing is fine, but that's as far as she'll let me go).
In some cases, ED can be a warning sign of more serious disease. One study suggests ED is a strong predictor of heart attack, stroke, and death from cardiovascular disease. The researchers say all men diagnosed with ED should be evaluated for cardiovascular disease. This does not mean every man with ED will develop heart disease, or that every man with heart disease has ED, but patients should be aware of the link.