Also, sometimes if you look long and hard enough, you can find affordable rent in SF. It took me a month in a half, but I found in apartment in Nob Hill for $650 a month, and I have paid more before in the East Bay for less space. I bet if you gave yourself plenty of time to do an apartment search, you could find something near campus for less than $700 a month.
Also, the other thing to consider that may add to the cost of commuting is food. When you live close to campus, it's easy to go home for lunch, dinner...I know as time goes on and I start to creep out of bed later and later and the semester moves on, I stop packing sack lunches and dinners and then start grabbing food out more and more...this adds up in cost as well. $10 a day for lunch and dinner, $50 a week, $200 over the course of a month plus $8 a day for transportation...you're already starting creep close to $400 a month.