Or you know.. Carry mace or a taser.
Gun against gun, the quicker someone is to shoot, the more likely they'll be the ones surviving.
If someone already has a gun to their head the chances of being able to pull out a gun or run away is slim to none.
On the other hand, if you're in a knife fight, that other person has to be able to reach you which gives you ample time to get away.
If the assailant takes two steps back with a gun, you're still dead. With a knife? You have a fighting chance.
Strength and perseverance is important with knifes, but you can take a couple defense classes to help your chances. With guns, it's whoever pulls the trigger faster and most of the time it's the one who pulled it out first.