LOUISVILLE, Ky. (AP) _ The failure rate on the national nursing exam given in July went up across the country, and in Kentucky that exacerbated a nursing shortage in hospitals, nursing homes and other health-care facilities.

Nursing-school graduates can work as registered nurses until their test results arrive but those who fail lost their positions, and that has left the industry scrambling to find replacements.

''It's terrible timing,'' said Carolyn A. Williams, dean of the University of Kentucky School of Nursing, who worries that the bad results also will scare young people away from a nursing career.

Nationally, 16.4 percent of people who took the two-day exam for the first time in July failed, said Carolyn Yocom, director of research services for the National Council of State Boards of Nursing, which prepares the exam.

That is the highest failure rate since the council started the exam in 1982. Last year, just 9 percent of first-time test takers failed, and in previous years the failure rate ranged from 8 percent to 12 percent, Yocom said.

The failure rate increased in all 50 states, she said. The failure rate in Kentucky was about 20 percent, up from 10 percent in July 1987 and 8 percent to 12 percent in previous years, said Patricia Calico, president of the Kentucky Board of Nursing.

Michael Rush, vice president for member services of the Kentucky Hospital Association, said a survey the association did in 1987 found that one in 10 registered-nurse positions in Kentucky hospitals was unfilled.

''We're in a real bind,'' said Bill Massie, chief operating officer of the University of Kentucky's Albert B. Chandler Medical Center.

The UK Medical Center already had closed three intensive-care-unit beds because it didn't have enough nurses, Massie said.

Changes in the test partly help explain the higher failure rate. This year's test covered new subjects to reflect the changing skills and knowledge required of entry-level nurses, Yocom said.

Also, the number of correct answers needed to pass was increased, but by fewer than 10 out of the total of 300 questions asked, she said. The council won't reveal how many correct answers are needed to pass the test.

Yocom said the council expected the failure rate to increase but not by as much as it did.

She said changes in the exam accounted for only half the increase. She theorized that increasing opportunities for women in other professions, night and weekend hours in many health-care settings, and non-competitive salaries have prompted fewer top-quality people to enter nursing.

The Kentucky Board of Nursing has asked the national council to offer the exam three times a year instead of twice so nurses can get into the work force more quickly. The next scheduled exam is in February, and by the time those results come out, nurses who failed in July but pass in February would not be able to start work until about April.