Appendix ASOLUTIONS TO SELECTED EXERCISES
More detailed answers for all of the exercises are located at http://dornsife.usc.edu/labs/rwilcox/books/ in the file answers_wiley.pdf.
Chapter 1
3. sum(x)/length(x)
4. sum(x[x>0])
5. id=which(x==max(x))
mean(x[-id])
, which returns 1.25. 6. The values are and . 7. The average is 24.1. 9. sum(x)/length(x)
returns 4.8. x-4
subtracts 4 from each value. 10. sum(x-mean(x))
returns 1.776357e15, where e15 means . The exact value is zero. 11. Two commands: id=!is.na(m[,1])
and m[id,]
Chapter 2
1. (a) 22, (b) 2, (c) 20, (d) 484, (e) 27, (f) , (g) 2, (h) 220, (i) 12, (j) 54. 2. (a) , (b) , (c) . 4. (a) , , (b), . 5. , . 6. 338.1. 7. (a) 30.6, (b) 120.6, ...
Get Understanding and Applying Basic Statistical Methods Using R now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.