I'm not saying it's your fault, but at least take some precaution.
1. Walk with a purpose
This is tried and tested. Muggers won't notice you if you brisk walk past them. They are more likely to take note of your shiny earrings, your gold watch, and your brand new cellphone if they have more than ten seconds to look at them. Also, if you walk fast, muggers won't bother running after you. A moving target is harder to catch. Unless your pursuers do cardio (in that case, give it up coz you're fucked).
2. Don't dangle your prized possessions in front of would-be muggers
I know that showing off your phone does not make it legal for people to steal it, but muggers don't really adhere to our kind of logic. So if you want to enjoy that DSLR for more than two weeks, don't make it a necklace. Wearing it around your neck is like screaming "Take it! Take it! It's here!" Well, at least that's what muggers would say to defend their surprise attack on you. I know you can't wait for people to acknowledge you as a "serious photographer", but I'm pretty sure there are other ways for you to prove that. Like by, I don't know, taking really good pictures?
3. Don't bring your prized possessions everywhere if you don't need them
The number of people who cannot live without gadgets is exponentially increasing, so I suppose this might be a tad impossible for technomaniacs (did I just invent a new word?). But like all things, there is a time and place for everything; including your unrequited love for your iPad. If you're just going out to buy vinegar from the nearest sari-sari store, you don't have to lug the thing around. It's not a puppy. It's not going to miss you. You can leave it in the house for half a day and it won't starve to death. Promise. So go out, have an actual conversation for once, and experience the liberating feeling of not having to entertain the possibility of your gadget being stolen and/or your neck being impaled by an ice pick.
4. Look like you're not worth mugging
Whenever I go to places where there is rampant mugging, I adhere to a strict dress code. I call it "Nursery Ninja". It's a mix of innocence and the barely contained aura of instinctive homicide. I try to dress like I'm too young and poor to be robbed, but if someone even attempts it, I will have no qualms karate-chopping their nearest body part. I do not wear miniskirts. I do not wear high heels. Most of all, I make sure that any prized possession is stuffed inside my shirt. Forget trying to look pretty or handsome. You'll have more time for that if you don't get shot in the head by a desperate rugby boy.
5. Be alert
They say that in life, you should stop and smell the roses. I guess you could do that when you're in a garden literally full of roses and people just go milling about as they are wont to do in a garden. But if you're in a dark city street, I suggest you do not stop and smell anything. This should be rule number one, actually. Minding one's business is probably the most effective way for you to avoid mugging. Look at your surroundings, but not too long enough that you'd attract unwanted attention. Focus on where you're walking, do not talk to strangers, and lastly, be aware if someone already has his entire hand inside your backpack. In short, if you're not an oblivious moron, I'm pretty sure you'll get home alive.