Department of Statistics: Course Stats 330
Department of Statistics: Course Stats 330
Assignment 1, 2006
Instructions: Hand in your completed assignment to the Student Resource Centre by 4pm
on Thursday 3rd August.
Question 1.
The data set in the file rabbit.csv (available on the course web page) contains some
data gathered in an experiment to study the effect of the 5-HT_3 antagonist MDL 72222.
Five rabbits were studied on two occasions, after treatment with saline (control) and after
treatment with the 5-HT_3 antagonist. After each treatment, ascending doses of
phenylbiguanide were injected intravenously at 10 minute intervals and the responses of
mean blood pressure measured. The goal was to find out if the effect of increasing doses
of phenylbiguanide on the mean blood pressure is different for the treatment and the
control.
Load the data into R. (You will have to include the code for doing this in your answer to
get any marks). Draw a suitable graph or graphs that will allow you to examine the effect,
if any, of the treatment on the relationship between dose and blood pressure. What
conclusions do you reach? Do all rabbits respond in the same way?
NB: you can find more information about this experiment in the article
1
Question 2.
In R, there are many built-in data sets, in the form of data frames. For a list of these, you
can type
?AirPassengers
Use the R data sets indicated below to draw an example of each of the following plots, and
comment on what the plot is saying:
a) Use trellis graphics to draw a series of side-by side boxplots to illustrate the
relationship between a continuous variable and a categorical variable (use the data
frame InsectSprays in the datasets package, treating the count variable
as continuous). Provide a title and informative axis labels. [5 marks, 4 for the plot
and 1 for comments]
b) Draw a picture of a surface using a wireframe plot (use the data frame volcano in
the datasets package). Use informative labels for the axes. [5 marks, 4 for
the plot and 1 for comments]
c) Draw a scatterplot, with the points annotated with a label, and the group to which the
observation belongs denoted by different plotting symbols. (Use the data set
cathedral in the faraway package. This gives the nave heights and lengths
of 25 cathedrals in England, together with the type of cathedral (r = Romanesque,
g =Gothic). You can get the cathedral names by typing
cathedral.names = rownames(cathedral)
The R function text is useful for labeling the points, and the function points
for drawing different kinds of plotting symbols. Make sure you give the plot a title
and provide informative axis labels. [10 marks, 8 for the plot and 2 for
comments]
2
Data for Question 1 (also in file rabbit.csv)
3
5.00 50.00 MDL R3
26.00 100.00 MDL R3
25.00 200.00 MDL R3
2.60 6.25 MDL R4
1.20 12.50 MDL R4
2.00 25.00 MDL R4
3.00 50.00 MDL R4
11.00 100.00 MDL R4
22.00 200.00 MDL R4
2.40 6.25 MDL R5
2.50 12.50 MDL R5
1.50 25.00 MDL R5
2.00 50.00 MDL R5
9.00 100.00 MDL R5
19.00 200.00 MDL R5