* do-file for Supplementary Exercise 2.59 of IPS7e version 18 /* works also with versions 13-17 */ import delimited "R:\Chapter 2\ex02_059.csv" * two separate plots twoway (scatter time dist, sort), by(hand) encode hand, g(Hand) * two-part plot built by separate specification of two parts twoway (scatter time dist if Hand==1) (scatter time dist if Hand==2) twoway (scatter time dist if Hand==1) (scatter time dist if Hand==2) (lfit time dist if Hand==1) (lfit time dist if Hand==2) * separate regressions bysort hand: regress time dist