Millions of Americans have had to swear off shellfish, eggs, peanuts or soy to avoid allergic reactions that can range from stomach cramps to life-threatening swelling of the airways, new research shows.

Approximately 4 percent of Americans have a food allergy, with women and Asians the most affected, the study found.

"Recent reports suggest that food allergies are on the rise, with more food allergy-related hospitalizations in the U.S. over the last decade," said lead researcher Dr. Li Zhou. She's with the division of general medicine and primary care at Brigham and Women's Hospital in Boston.

Get Breaking News Delivered to Your Inbox

Food allergies cost the United States an estimated $25 billion annually, Zhou said.

For the study, Zhou and her colleagues reviewed nearly 3 million medical records identifying more than 97,000 patients who suffered from one or more food allergies or an intolerance to a food.

The most common allergy was to shellfish, such as shrimp and lobster, Zhou said.

"In addition, 1 in 6 patients with a food allergy or intolerance had a documented anaphylaxis [life-threatening swelling of the airways]," she noted.

Other common food allergies included fruits or vegetables, dairy and peanuts, the researchers found.

Food allergies can lead to reactions such as hives, anaphylaxis, shortness of breath, wheezing, itching, swelling or allergic-like reactions called intolerances, Zhou said.

Her team found that nearly 13,000 patients were allergic or had an intolerance to peanuts, including more than 7,000 who had experienced hives, anaphylaxis or other reactions.

But, only 1 in 5 patients with a peanut allergy received follow-up allergy testing, Zhou said.

Given the number of people in the United States with food allergies, the researchers think that more allergists are needed.

"The spectrum of severity observed with food allergy highlights the critical need for more allergy evaluations," Zhou said.

The report was published May 31 in the Journal of Allergy and Clinical Immunology.

In addition to shellfish, allergies to peanuts, tree nuts, eggs and milk are common, said Dr. Alisa Muniz Crim, a gastroenterologist at Nicklaus Children's Hospital in Miami.

Patients who have an anaphylactic reaction to a food must exclude that food from their diet, said Crim, who wasn't involved with the study.

"Many of these patients need to carry an EpiPen, which contains the drug epinephrine that acts quickly to open the airway, letting the patient breathe," she said.

Among children, common reactions are stomach cramps, vomiting, skin rashes and diarrhea, Crim said.

Some food allergies can be treated by gradually exposing patients to increasing amounts of the allergy-causing food until they build a tolerance to it, Crim said. But for people with severe allergies, avoidance is the best treatment, along with anti-allergy medications, she said.

Crim thinks that schools should have kits that include an EpiPen to treat kids who have an allergic reaction.

Dr. James Baker Jr., CEO and chief medical officer of Food Allergy Research and Education, said it's concerning that 1 in 6 patients with a food allergy in this study had experienced anaphylaxis.

"Avoiding or preventing these severe reactions is crucial to ensure the safety of individuals with food allergies," he said.