It depends. I spend a lot of time in the right side of the lane on the freeway, so that drivers can see me more easily in their left mirror (and hopefully not lane change into me). I move to the left if I am concerned that the driver in the left lane may not see me, in the hopes that he'll see me in his center/rh mirror. And in general, I don't stay next to any vehicles for extended periods of time if I can help it.
I'm not a big fan of riding in the center. Not only does oil, etc. accumulate there, but also if the car in front of you straddles some debris, it will be directly in your riding path, with little time to react. So I tend to stay in line with the left or right wheels of the vehicle in front of me, with my logic being that whatever their tires hit will go flying, probably to the left or right, with me swerving the opposite way.
When in the far right lane on the freeway, I tend to hang out in the left side of the lane so that 1) the cars in the left lanes can see me more easily and 2)I have more pavement to work with should I have to swerve around something in my lane.
On divided, two way roads, I tend to travel just right of the centerline, so that I have more asphalt to work with when swerving to the left or right. And moving over to the middle or right side of my lane when passing approaching cars of course.