If we take these as valid data:
https://www.bls.gov/regions/west/news-release/occupationalem...
And set an arbitrary threshold at 45 US$/hour, the amount of people exceeding that are 31.1%, if we set it at 50 US$/hour they are 19.4%.
If we draw another line, those that get less than 25 US$/hour are 42.1% and those that get more than 25 but less than 45 are 26.6%.
So, even if we assume that 40% of people commutes for long distances (and BTW technically are not SF residents), since only between 20% and 30% of San Francisco workers can actually afford it, it still leaves us with 30%-40% of people that must be in a really tight spot.
I mean, if you live in SF and have a yearly income of "only" 50-60,000 US$ working some 2000 hours at 25-30 $/hour, and you live in a house that you can rent for roughly the same amount or that you can sell for (say) a million, what actually keeps you there?
Maybe you can find somewhere else a similar job, paid in the 15-20 $/hour range, you lose 20,000 on the job but get an additional 40,000 from the rent or from interests on the capital.
To be more accurate, it is only a subset of SF residents (in the IT space) that get that kind of pay, I often wonder how is the life of those that do not belong to that elite and that do not make that kind of 6 figures money.