First case: a single dichotomous variable. Our example: Pre 1980 vs Post 1980.
The way JMP does it (contrast = sum in S-Plus): model
where z = 1 if observation is in the first group and -1 if observation is in the second group.
Check to understand the model: plug in z = 1 and -1.
Group 1 model
Group 2 model
Compare Group 1 and Group 2.
Av(Y|x,z=1) - Av(Y|x,z=-1) is the difference in height between the two regression lines.
Notes.