SAN FRANCISCO (AP) _ Despite some well-publicized outbreaks at sea, the risk of getting sick from bad food on a cruise ship has never been lower, federal officials say.

Still, there is room for improvement.

Investigators from the U.S. Centers for Disease Control and Prevention said Wednesday that they investigated 31 cruise-ship outbreaks of diarrhea between 1986 and 1993.

The most common causes of intestinal ills turned out to be undercooked scallops and eggs. Ships' chefs could have avoided about one-third of the episodes if they had thoroughly cooked shellfish and used pasteurized eggs.

An estimated 4.8 million people take cruises on ships in North America every year. Even an occasional outbreak can afflict a lot of people, since about one-third of passengers get sick whenever there is a bout of food poisoning.

``People should think about this and be sure any food they eat on a cruise ship is thoroughly cooked,'' said Denise Koo of the CDC.

She said the old adage about eating in foreign locales should apply: ``Boil it, peel it, cook it, or forget it.''

Koo and colleagues presented their latest cruise ship data at an infectious disease conference sponsored by the American Society for Microbiology.

The CDC calculates the number of outbreaks for each day a passenger is on a cruise. In the 1970s, there were 8.1 outbreaks for every 10 million passenger days. In the 1980s, this fell to 3, and in the 1990s to 2.1.

``It's becoming safer to go on a cruise ship that docks in the United States,'' said the CDC's Dr. Kim Cook.

Ships that call on the United States get surprise inspections twice a year by investigators from the National Center for Environmental Health. However, ships that don't touch land in the United States do not get federal inspections and indeed may not be overseen by any regulators.

Besides undercooking, another frequent source of on-board illness is contamination by sick food handlers. CDC investigators blamed this for a large outbreak last September on the ship Viking Serenade as it sailed from San Pedro, Calif., to Baja California in Mexico.

Cook said the culprit, the bacteria shigella, is only found in the human intestine. Several different foods on the ship's departure buffet were tainted. Before the cruise was over, 500 people _ one-third of those on board _ had gotten sick, and one died.

Ships' kitchen workers are often reluctant to call in sick because they are afraid of getting fired, Koo said.

More than 60 percent of diarrheal outbreaks on cruises could be prevented by thoroughly cooking food, using pasteurized eggs, using the ships' kitchens rather than local caterers for onshore meals and encouraging sick food handlers to stay off the job, she said.

``You have to be an informed consumer, but we don't want to discourage people from going on cruises,'' Cook said.