Yes. Anxiety, stress, and unproductive thought patterns can lead to difficulties getting and maintaining an erection.