* do-file for Extra Exercise 22 version 18 /* works also with versions 13-17 */ import delimited "R:\Chapter 10\ex10_033.csv" pwcorr retinol crp, sig spearman retinol crp * manual calculation of Spearman's rho, for demonstration purposes egen rankret=rank(retinol) egen rankcrp=rank(crp) pwcorr rankret rankcrp, sig import delimited "R:\Chapter 2\ex02_002.csv" * from Exercise 10.7 pwcorr round1 round2, sig pwcorr round1 round2 if player~=8, sig pwcorr round1 round2 if player~=7 & player~=8, sig * Spearman's rank correlation spearman round1 round2 spearman round1 round2 if player~=8 spearman round1 round2 if player~=7 & player~=8