Using statistics from 2014 (because that's when I last did the research) San Juan's murder rate was lower than the murder rate of Detroit, New Orleans, St. Louis, Baltimore, Newark, and Oakland. It was a tad worse than Chicago. It's also important to keep in mind that most murders in Puerto Rico are the result of gang on gang warfare and just like everywhere else there are some good neighborhoods and some bad neighborhoods. Compared to Mexico San Juan's murder rate is a fraction of the murder rate of cities like Acapulco and lower than infamous border cities like Tijuana.
Puerto Rico as a whole has a higher murder rate than the USA and Mexico because of its ridiculously high population density. It's a small island (roughly the size of Connecticut) but it has one of the highest population densities in the states. Even in rural areas you're only a stone's throws away from your neighbor. In the USA and Mexico, however, you average the murder rate of thousands of safe and quiet towns with the murder rate of a few bad cities so you end up with relatively good numbers.
To give you some perspective, if you were to choose between Mexico and Puerto Rico without intimate knowledge of the two places you would probably choose Mexico because it has a lower murder rate than Puerto Rico. But if you were to choose between Acapulco and San Juan you would definitely choose San Juan because its murder rate is less than a third than the murder rate of Acapulco even though San Juan is Puerto Rico's deadliest city.
What I mean is statistics can be considerably more misleading when the methodology is not explained. I found your comment incredibly helpful in understanding the point you were making.
When I was living there, I generally didn't feel unsafe. As long as you avoid dangerous areas, I think the likelihood of something happening to you is fairly low. Although I'll admit I feel safer in Santa Clara. Certain parts of San Francisco feel pretty unsafe to me. I'd avoid walking around Tenderloin at night just as much as La Perla.
I've been told that even though the murder rate is high, it's mostly due to gang and drug related violence.
One of my friends that lives in the metropolitan area told me that in recent years she has felt less safe than before. She claims that she has perceived an increase in brutality, and that criminals no longer give a fuck. This is a rough paraphrased translation.