For a recent paper, researchers examined monthly data on U.S. background checks for gun purchases and permits from November 1998 through April 2016, looking for purchasing trends after shootings during that time. 

When media coverage highlighted shootings, they found there were increases in handgun purchases. Only after high-fatality shootings were there decreases. The authors segmented results by the shooter’s race/ethnicity, the region where the shooting occurred, if a shooting was school related, fatalities, if it was a handgun or rifle, automatic or semiautomatic, the extent of media coverage level, and state political affiliation.

Why they chose to list automatic and semi-automatic when no automatic weapons were used is a mystery - it could be bias on their part, they want to make automatic weapons sound prevalent, or it could be a media honeypot because journalists want to believe automatic weapons are used in over 70 percent of shootings, or they know little enough about guns and shootings that they went in not realizing machine guns are not common in Chicago or New York since 1934. The results found that 58 percent were committed by minorities and 42 percent were in Republican states. A total of 48 major "mass" shootings (defined as five or more individuals injured or killed) over an 18 year period made a difference in the 234 million background checks that occurred.  They found that 26 of the shootings were associated with increases in gun purchases and 22 of the shootings were associated with decreases.

JAMA Network Open. 2019;2(4):e191736. doi:10.1001/jamanetworkopen.2019.1736

Chicago even had shootings during a birthday party and while filming a music video.

Obviously there is nothing causal in this and population-level metrics are not not much help for understanding individual events, but they are helpful in gaging reactions to events. Lawful gun owners don't rush out to buy more guns for protection due to a media frenzy nor are they less likely to make a purchase based on the news cycle, but publicity from crimes could get people thinking about buying a gun because they are worried that government will ban them.

That 38.7% of major mass shootings led to changes in gun purchases might not really be a surprise - the demographic most likely to buy home burglary services behind those who had a home invasion is neighbors and friends of the victims - but thinking about media coverage is important if we want to understand why people purchase guns, if they otherwise would not.

Citation: Gina Liu, BA, BSc; Douglas J. Wiebe, PhD, A Time-Series Analysis of Firearm Purchasing After Mass Shooting Events in the United States, JAMA Network Open. 2019;2(4):e191736. doi:10.1001/jamanetworkopen.2019.1736