Friday, November 2, 2012
The data for this assignment is Stirrett.txt, a tab-delimited text file.
These data are taken from Skirrett et al. (1937) and are reproduced in Beall (1940) and Evans (1953). The object is to determine the effect of fungus (Beauveria Bassiana) spore treatment on the control of European corn borer, Pyrausta nubilalis. The four different treatment that were used are described below. The reported applications of fungal spores are in grams per acre.
Table 1 Characterization of the four treatments |
Treatment | Application on July 8 | Application on July 19 |
1 |
0 |
0 |
2 |
0 |
40 |
3 |
40 |
0 |
4 |
40 |
40 |
The first treatment occurred at the beginning of the period of oviposition while the second treatment was administered at the height of the period of oviposition. Eggs were allowed to hatch and the larva allowed to grow to full size. What is recorded are the number of borers that were found on a unit area occupied by a hill of corn. For each treatment 120 hills of corn were examined. The table below records the number of hills exhibiting different levels of infestation (first column) under the the four different treatment regimes (columns 2 through 5).
Table 2 Frequency of borers under four treatment regimes |
Number of borers per hill of corn | Frequency | |||
Treatment 1 | Treatment 2 | Treatment 3 | Treatment 4 | |
0 | 19 |
24 |
43 |
47 |
1 | 12 |
16 |
35 |
23 |
2 | 18 |
16 |
17 |
27 |
3 | 18 |
18 |
11 |
9 |
4 | 11 |
15 |
5 |
7 |
5 | 12 |
9 |
4 |
3 |
6 | 7 |
6 |
1 |
1 |
7 | 8 |
5 |
2 |
1 |
8 | 4 |
3 |
2 |
0 |
9 | 4 |
4 |
— |
0 |
10 | 1 |
3 |
— |
1 |
11 | 0 |
0 |
— |
1 |
12 | 1 |
1 |
— |
— |
13 | 1 |
— |
— |
— |
15 |
1 |
— |
— |
— |
17 |
1 |
— |
— |
— |
19 |
1 |
— |
— |
— |
26 |
1 |
— |
— |
— |
Notice that after count category 13 there are gaps in the observed frequencies for Treatment 1. You will need to deal with these gaps when constructing the goodness of fit test. Here's a "clever" way to introduce 0 values into a sequence of integers with gaps. To illustrate it I begin by generating some data in which the count category variable x has gaps. The values x = 8, 11, 13, and 14 were not recorded.
I next create a data frame with a single column. The column is given the name x, the same name as the count category variable in the data frame mydata. Unlike mydata$x this x has all of the intermediate values from 0 through 15.
Next I merge this new data frame with mydata using the all=T argument. This option causes all observations from both data frames to be included in the merge even those observations that do not match. The matching is carried out using variables with have same namse in the two data frames, in this case the variable x.
When we examine the merged data frame we see it contains all the values of x from 0 to 15. The variable y from mydata has missing values for the new observations.
Finally I assign zeros to the values of y that are missing.
Jack Weiss Phone: (919) 962-5930 E-Mail: jack_weiss@unc.edu Address: Curriculum in Ecology, Box 3275, University of North Carolina, Chapel Hill, 27599 Copyright © 2012 Last Revised--October 25, 2012 URL: https://sakai.unc.edu/access/content/group/3d1eb92e-7848-4f55-90c3-7c72a54e7e43/public/docs/assignments/assign8.htm |