* do-file for Supplementary Exercise 2.59 of IPS7e version 13 /* works also with version 14 */ import delimited "H:\VHM\VHM801\Datasets\csv\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