It varies depending on the elasticity of the building.
If the building is earthquake proofed, it will tend to dampen the effect of the quake, so that the top can shake less than the base.
If the building is stiff masonry, it will crack when the difference between the base and the upper levels exceed 2-3 inches for every floor, and when it's higher than that, there are good chances that the building will collapse.
The violence on different levels depends on the resonance of the building, the swing effect. If the resonance at the top compensates the periodicity of the quake, it will be less violent at the top.
If the resonance amplifies the quake, the top will swing additively, so that the top will have a bigger movement than the base.
That's another reason different buildings have different chances of collapsing based on their resonance.
It's possible that one end shakes a greater distance while another end shakes faster with less amplitude / less range.