Despite recent improvements, Pennsylvania remains one of the nation's most dangerous states for traffic fatalities, while New Jersey, by some measures, is among the safest, according to a new study.

Pennsylvania had the fourth-most traffic fatalities in 2012, with 1,310 people killed in traffic accidents. New Jersey recorded 589 traffic deaths, which placed it 22d among the states.

That represented a significant reduction from the number of traffic deaths in 2005. Pennsylvania's number of fatalities dropped by 18.9 percent, while New Jersey's was down by 21.3 percent.

Based on miles driven and state population, New Jersey fared very well, while Pennsylvania's fatality rate was significantly worse, according to an analysis by Michael Sivak of the University of Michigan's Transportation Research Institute.

Measured by fatality rate based on miles traveled, New Jersey was the fifth best among the states, with 7.94 fatalities per billion miles driven. Pennsylvania was 34th, with 13.25 fatalities per billion miles driven.

The national average rate was 11.30.

Measured by fatality rate based on population, New Jersey (the 11th-most populous state) was sixth best among the states, with 6.64 deaths per 100,000 people, while Pennsylvania (the sixth-most populous state) was 21st, with 10.26 deaths.

The national average rate was 10.69.

Pennsylvania did not fare as well as its neighbor to the east because it has many more rural roads, said Jenny Robinson of the AAA Mid-Atlantic auto club.

"Rural roads have a higher fatality rate than urban roads, and Pennsylvania has a lot of rural areas and roads compared to New Jersey," Robinson said, noting that Philadelphia has a much lower traffic fatality rate than rural counties in Pennsylvania.

And seat-belt use is higher in New Jersey than in Pennsylvania, Robinson said. New Jersey has a "primary" seat-belt law, which allows police to stop a motorist for not buckling up, while Pennsylvania's law only permits police to cite an unbuckled motorist who is stopped for another offense.