Nocturnal penile tumescence testing (NPT) may be useful in distinguishing mental from physical impotence. This test involves the placement of a band around the penis that you would wear during two or three successive nights. If an erection occurs, which is expected during rapid eye movement (REM) sleep, the force and duration are measured on a graph. Inadequate or no erections during sleep suggests an organic or physical problem, while a normal result may indicate a high likelihood of emotional, psychological, or mental causes.
It is estimated that up to 20 million American men frequently suffer from impotence and that it strikes up to half of all men between the ages of 40 and 70. Doctors used to think that most cases of impotence were psychological in origin, but they now recognize that, at least in older men, physical causes may play a primary role in 60% or more of all cases. In men over the age of 60, the leading cause is atherosclerosis, or narrowing of the arteries, which can restrict the flow of blood to the penis. Injury or disease of the connective tissue, such as Peyronie's disease, may prevent the corpora cavernosa from completely expanding. Damage to the nerves of the penis, from certain types of surgery or neurological conditions, such as Parkinson's disease or multiple sclerosis, may also cause impotence. Men with diabetes are especially at risk for impotence because of their high risk of both atherosclerosis and a nerve disease called diabetic neuropathy.
Chancellor et al. (109) compared VEDs with papaverine injections in 18 males with SCI. The injections and pumps were equally effective in inducing erections and no adverse effects from the treatments were reported. Treatment arms were crossed over, subsequently seven men chose the VED and seven men chose the papavarine highlighting equal efficacy in this population. In another treatment arm topical minoxidil was applied without any effective erections achieved by the study subjects.
In a prospective study from the Prostate Cancer Prevention Trial database, Thompson et al reported that men presenting with ED had a significantly higher chance of developing a cardiovascular event over a 7-year follow-up period.  The hazard ratio was 1.45, which is in the range of risk associated with current smoking or a family history of MI.
Aging, liver and kidney problems, and concurrent use of certain medications (such as erythromycin [an antibiotic] and protease inhibitors for HIV) slows the metabolism (breakdown) of sildenafil. Slowed breakdown allows sildenafil to accumulate in the body and potentially may increase the risk of side effects. Therefore, in men over 65 years of age, in men with significant kidney and liver disease, and in men who also are taking medications called protease inhibitors, the doctor will initiate sildenafil at a lower dose (25 mg) to avoid accumulation of sildenafil in the body. A protease inhibitor ritonavir (Norvir) is especially potent in increasing the accumulation of sildenafil, thus men who are taking Norvir should not take sildenafil doses higher than 25 mg and at a frequency of no greater than once in 48 hours. Other medications that may affect the level of sildenafil include erythromycin and ketoconazole.
Penile erection is managed by two mechanisms: the reflex erection, which is achieved by directly touching the penile shaft, and the psychogenic erection, which is achieved by erotic or emotional stimuli. The former uses the peripheral nerves and the lower parts of the spinal cord, whereas the latter uses the limbic system of the brain. In both cases, an intact neural system is required for a successful and complete erection. Stimulation of the penile shaft by the nervous system leads to the secretion of nitric oxide (NO), which causes the relaxation of smooth muscles of corpora cavernosa (the main erectile tissue of penis), and subsequently penile erection. Additionally, adequate levels of testosterone (produced by the testes) and an intact pituitary gland are required for the development of a healthy erectile system. As can be understood from the mechanisms of a normal erection, impotence may develop due to hormonal deficiency, disorders of the neural system, lack of adequate penile blood supply or psychological problems. Spinal cord injury causes sexual dysfunction including ED. Restriction of blood flow can arise from impaired endothelial function due to the usual causes associated with coronary artery disease, but can also be caused by prolonged exposure to bright light.
The primary nerve fibers to the penis are from the dorsal nerve of the penis, a branch of the pudendal nerve. The cavernosal nerves are a part of the autonomic nervous system and incorporate both sympathetic and parasympathetic fibers. They travel posterolaterally along the prostate and enter the corpora cavernosa and corpus spongiosum to regulate blood flow during erection and detumescence. The dorsal somatic nerves are also branches of the pudendal nerves. They are primarily responsible for penile sensation. 
In order to establish whether normal erections are occurring overnight (nocturnal erections), the doctor may organise nocturnal penile tumescence (NPT) testing. This involves wearing a monitor overnight in your own home. The data from this monitor is then assessed to analyse how often erections occurred, how long they lasted, and how rigid and large the penis was during the erections. If NPT testing is normal, the cause of erectile dysfunction is usually psychological. If not, further testing of the blood flow in the genital area may be required to see if there is blockage or leakage. The doctor may also organise a blood test of levels of hormones such as testosterone, prolactin and thyroid stimulating hormone to see if these are contributing to the erectile dysfunction.
Certain street drugs such as "poppers" also can cause serious problems if taken with PDE5i medications. These poppers are often types of nitrates and can cause severe drops in blood pressure. Ecstasy is another street drug that may increase sexual desire but interferes with performance. This has prompted some men to combine ecstasy with PDE5i medications. This mixture (a combination sometimes called "sextasy") can improve erection ability but also causes severe headache and priapism. (Priapism is an abnormally prolonged erection that becomes extremely painful and may result in permanent damage to the erection mechanism.) There are also potentially dangerous effects to your heart from mixing PDE5i medications with various other street drugs.