I didn't study as much physics as I would have liked in college, so maybe someone else can touch up on my points a little more or correct me if I'm wrong, but I think this is how it works.<br /><br />Basically, gravity is going to pull you toward the center of the Earth. It doesn't matter what you are doing or where you are, gravity is going to try to pull you down. But there are other forces acting on you that keep you from actually being sucked to the center of the Earth. When you are on your roof, there are electromagnetic forces between your feet and the roof (both your roof and your feet or shoes are made up of atoms which are comprised of protons and electrons which have charges associated with them which is where the electromagnetic forces come from). These electromagnetic forces are what allow you to actually be on the roof because these forces are stronger than the force of gravity pulling you down, which is why you can be on your roof without gravity pulling you down to the Earth's core. If you fall of your roof then that means that gravity is the strongest force acting on you. If you almost stepped off then while gravity was pulling you down, your muscles overcame the force of gravity to keep you on the roof. If you almost slid off but stopped without stopping yourself (perhaps by grabbing onto something or stopping yourself another way) then frictional forces overcame gravity to stop you from falling. If you almost rolled off then I would guess that you stopped yourself somehow and it was your muscles which overcame the force of gravity.<br /><br />Hopefully can say what I am trying to say but a little more clear.