The actual range for rent to income varies quite a bit based on expenses and vacancies and such, but it is unusual to see it too far our of the 8 to 12 percent range, 10 being the standard. It's an ongoing joke in real estate. (Don't feel bad if you don't get it. It's not that funny.)
Residential and commercial should stay in the same range to keep it simple. In real life residential would probably be a little lower because more people are willing to invest in a house or duplex and therefore there are more dollars competing for these investments. I'd ignore this if I were you. The differences are going to be minor.
I'll also point out that this ignores vacancy and unusual expenses for a property. You could increase the rent slightly to account for such things, but for a game I'd stick with the close but not quite. It won't be worth the extra math to mimic real life too closely.
<<I don't know enough about econimics to give specifics but what I would look up is standard mortgage rates vs. prices. Then base rent on that as rent is usually about equal to a mortgage payment in the real world.>>
Actually, that doesn't work exactly. If you want to look at standard mortgage rates and add about 3 percent then you'd be a lot closer. Think of it this way, who would invest in a house and rent it out, if he can't make more money than the mortgage payment? Sure property values are going up, but you have to make up for vacancies and generally folks want a little cash flow as well.
As for why folks rent when they could own for less it generally has to do with either how long they plan to stay in an area, the difficulty in obtaining financing, amassing a downpayment, or reaching the point that they decide to own as opposed to rent.
If you really want something a little more complex, I can generate an excel sheet pretty quick that should cover most of what you need. As for modifying the cost by area of town and so on, that is one of the tricky points for the D20 economics. It doesn't really consider supply and demand (and shouldn't) very well. For variety, just modify the cost and rent as DM deems appropriate for the area.