Just to clear something up, when i say caged, they actually have an incredibaly large, one off 'luxury complex' with a tree stump, hammock, dark house, light room, etc.. They are certainly not 'caged' in the 'hamster' sense.
You can housetrain a rat, to a certain degree.. how successful you are though, is down to the personality of the ratty in question.
Rats are mis-represented, IMO. It is too easy to think of a Rat hanging out in a sewer, full of 'The Black Plague'. This is far from the truth of the domesticated rat.