0% found this document useful (0 votes)
19 views4 pages

Department of Statistics: Course Stats 330

This document provides instructions for Assignment 1 of the STATS 330 course. Question 1 asks students to analyze data from a rabbit experiment studying the effect of a drug on blood pressure changes in response to increasing drug doses. Students are asked to load the data, plot it to examine treatment effects, and state their conclusions. Question 2 asks students to create specific plot types using built-in R datasets and comment on each plot. The data for Question 1 is provided.

Uploaded by

PETER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

Department of Statistics: Course Stats 330

This document provides instructions for Assignment 1 of the STATS 330 course. Question 1 asks students to analyze data from a rabbit experiment studying the effect of a drug on blood pressure changes in response to increasing drug doses. Students are asked to load the data, plot it to examine treatment effects, and state their conclusions. Question 2 asks students to create specific plot types using built-in R datasets and comment on each plot. The data for Question 1 is provided.

Uploaded by

PETER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

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.

The data set has 4 variables. These are

BPchange: change in blood pressure relative to the start of the experiment

Dose: dose of Phenylbiguanide in micrograms

Treatment: placebo (denoted by Control) or the 5-HT_3 antagonist MDL


72222 (denoted by MDL)

Animal: label of animal used ('"R1"' to '"R5"')

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

J. Ludbrook (1994) Repeated measurements and multiple comparisons


in cardiovascular research. Cardiovascular Research, 28, 303-311.

It is available in the library of the medical school (unfortunately not on line).


[creating data frame: 5 marks, suitable graph or graphs 8 marks, conclusions 7 marks]

PTO for Question 2

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

data(package = .packages(all.available = TRUE))

For example, in the package datasets there is a data frame AirPassengers. To


use it, type

library(datasets) # this may be preloaded


data(AirPassengers)

You can then refer to AirPassengers by name in other R commands. To get


information about the data set (e.g. number type and names of the variables, plus
background) 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]

Data set for Q1 follows overleaf (also on the web page)

2
Data for Question 1 (also in file rabbit.csv)

BPchange Dose Treatment Animal


0.50 6.25 Control R1
4.50 12.50 Control R1
10.00 25.00 Control R1
26.00 50.00 Control R1
37.00 100.00 Control R1
32.00 200.00 Control R1
1.00 6.25 Control R2
1.25 12.50 Control R2
4.00 25.00 Control R2
12.00 50.00 Control R2
27.00 100.00 Control R2
29.00 200.00 Control R2
0.75 6.25 Control R3
3.00 12.50 Control R3
3.00 25.00 Control R3
14.00 50.00 Control R3
22.00 100.00 Control R3
24.00 200.00 Control R3
1.25 6.25 Control R4
1.50 12.50 Control R4
6.00 25.00 Control R4
19.00 50.00 Control R4
33.00 100.00 Control R4
33.00 200.00 Control R4
1.50 6.25 Control R5
1.50 12.50 Control R5
5.00 25.00 Control R5
16.00 50.00 Control R5
20.00 100.00 Control R5
18.00 200.00 Control R5
1.25 6.25 MDL R1
0.75 12.50 MDL R1
4.00 25.00 MDL R1
9.00 50.00 MDL R1
25.00 100.00 MDL R1
37.00 200.00 MDL R1
1.40 6.25 MDL R2
1.70 12.50 MDL R2
1.00 25.00 MDL R2
2.00 50.00 MDL R2
15.00 100.00 MDL R2
28.00 200.00 MDL R2
0.75 6.25 MDL R3
2.30 12.50 MDL R3
3.00 25.00 MDL R3

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

You might also like