FWIW - I was taught that it may be possible to deter a would be attacker by cultivating body language. Most attackers will be looking for an easy victim - they don't want to work too hard or risk injury to themselves. By developing a confident posture and even, if you can, making yourself look unwelcoming, an attacker may decide that you look like too much trouble.
When I worked I occasionally had to travel back to my home just outside London from the City. That meant an hour's journey on a train travelling through some of the seedier parts of the metropolis. I always sat in a corner, out my bag on the seat beside me (with the strap over my arm) and read a book or a paper. I was aware of what was going on around but never made eye contact with other travellers. Much as you may dislike it giving off the right vibes can be protection in itself.
Walking through the City at night, my bag was always under my arm with my forearm resting over the top of it. I kept a watch in any available windows to check who might be behind me - sometimes the shadows from street lights can give a lot of information. I always tried to look as if I belonged there and that the fact that it was dark and the streets were deserted did not concern me.
It is a shame that we have to think in these ways but, better that than to be the victim of an attack because you weren't aware of what was happening around you. I'm not sure what I would/could do if attacked. At 5'2" and with arthritis I really do not have much strength to fight off an attacker. I'm not sure that, like Janie, I wouldn't freeze if attacked. I hope that I never have to find out.