Answer:
Most studies indicate that mental illness is responsible for only a small fraction (about 3 percent to 5 percent) of all violent crimes committed in the United States every year, and most of those episodes of violence are committed by individuals who are not currently receiving mental health treatment.
There is, however, a strong connection between acts of mass public violence including; mass public shootings and untreated serious mental illness.
Regardless of the above-mentioned fact, a history of childhood abuse or use of alcohol or drugs can increase the odds of violence or of such attacks even when the said individual has had no diagnosis of a specific mental illness.