*****Brain Weight Data, SW text ex 2.12 pp. 22-23******** Stat141 9/26/06 > brain = read.table(file="D:\\stat141\\brain-wt.rData", header = T) > summary(brain) brainwt sex Min. : 915 f: 77 1st Qu.:1096 m:108 Median :1211 Mean :1207 3rd Qu.:1300 Max. :1660 > stem(brain$brainwt) The decimal point is 2 digit(s) to the right of the | 9 | 24 9 | 56788 10 | 001122233334444444 10 | 555556677799999999 11 | 00000111111222233334444 11 | 555667777788888899999 12 | 000011122233333333333334444 12 | 555555555666667777788899 13 | 0000111111222334444 13 | 555666788999 14 | 0111224 14 | 68 15 | 134 15 | 56 16 | 1 16 | 6 #histograms text p.23 percvec = seq(0,1,.1) #make percentile values for min to max > quantile(brain$brainwt, percvec) 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% 915.0 1035.8 1085.0 1117.6 1170.0 1211.0 1235.8 1269.0 1311.0 1383.0 1660.0 #condition on sex > tapply(brain$brainwt, brain$sex, summary) $f Min. 1st Qu. Median Mean 3rd Qu. Max. 937 1038 1096 1117 1190 1392 $m Min. 1st Qu. Median Mean 3rd Qu. Max. 915 1193 1260 1271 1344 1660 > tapply(brain$brainwt, brain$sex, stem) The decimal point is 2 digit(s) to the right of the | #female #male 9 | 4 9 | 2 9 | 56788 9 | 10 | 0011223334444444 10 | 23 10 | 5555667799999 10 | 57999 11 | 00001112233344 11 | 011122344 11 | 557788889 11 | 566777889999 12 | 000123334 12 | 011223333333333444 12 | 5555678 12 | 55555666677778899 13 | 24 13 | 00001111112233444 13 | 9 13 | 55566678899 14 | 0111224 14 | 68 15 | 134 15 | 56 16 | 1 16 | 6