Speaking of robberies at knife and gunpoint, I recommend minimising the attack surface. If you're a man, get a small, thin wallet that doesn't protrude visibly from your pocket. Don't put any credit/debit cards, driver's licenses, etc. in it -- these are all things whose main cost when they are stolen is enormous inconvenience. Put enough pesos in it for what you need, but an amount you could still live with being stolen. Don't carry around your passport if you can at all help it.
If you're a woman, stick to cheap purses, and don't carry anything overly important in them, or large sums of money.
If you have loose pockets that are easy to reach into surreptitiously, safety-pin them shut from the inside (so that the pin is not easily visible on the outside). Seriously. It's tacky, it's definitely not a trendy fashion accessory, but it works.