Stat 205 Homework 1 (Due: Beginning of class, September 01, 2016

advertisement
Stat 205 Homework 1 (Due: Beginning of class, September 01, 2016, Thursday)
Instructor: Yen-Yi Ho
Total Points: 100
Submission instruction:
Paste the plot from R in a word file, type the other answers, comments etc. in the same file.
Put your name on the top line and print the solution to submit it in the class.
(EMAIL SUBMISSION WILL NOT BE ACCEPTED)
1. A Paleontologist measured the width (in mm) of the last upper molar in 36 specimens of the
extinct mammal Acropithecus rigidus. The data is posted on the web. Use the following url
in R to access the data
http://www.stat.sc.edu/~chakrabp/STAT205/data/width.txt
Code Help:
data=read.table("http://www.stat.sc.edu/~chakrabp/STAT205/data/width.txt", header=FALSE)
width=data[,1]
#hist(width, insert other specifications) a. Construct a frequency histogram with molar width (8 bins). (20 points)
b. Comment on the shape of the frequency distribution (make at least three plots with
different number of bins before you decide the shape, show the plots). (10 points)
c. Report five numbers summery of the data. (i.e. Min, 1st quartile or Q1, median, 3rd
quartile or Q3, Max), the IQR, and the range. (10 points)
Hint: IQR = Q3 - Q1, Range = Max - Min
Note that you can obtain Q1 in R as quantile(width,0.25) and Q3 as
quantile(width,0.75). You may also use min(width) and max(width).
2. A pharmaceutical company is developing a new drug for helping migraine patients. Patients
were studied. The drug was administered when a patient is under severe migraine attack and
they were asked to rank the level of pain after one hour. Following is the observed data
Pain Level
Frequency Percentage
Severe
21
?
Moderate
37
?
Mild
59
?
Nonexistent 3
?
(a) What are the observational unit and the variable of the study? (5 points)
(b) Make a barplot using R to represent the data with frequency. (15 points)
(c) Calculate the percentage for each group and make another barplot showing the
percentages of patients in each group. (5 points)
3. Textbook problem section 2.4, page 51 Problem 2.4.2 (all parts). 35 points
Download