I also have walked alone in Madrid and nothing has happened to me.However, over the years I have witnessed crimes-near the Plaza Mayor a woman was knocked down and robbed, a man was hit and robbed near Principe Pio,victims of shop lifting in a store and on the bus. a fellow female traveler was pulled into a doorway and badly beaten and robbed.
I have to mention that nowadays there is a greater police presence in Madrid -they are even on horseback!
These events have rattled me but I still stroll around but definitely more alert.I don't take the subway anymore-I try to walk but it's been fun and challenging to figure out the bus system!
I often go to the theater late at night and then I take a cab!Cheap enough and I ask the cab driver to wait until I get inside the door!