This test is to be written in the BSB Student Technology Centre. The duration of the test is 2 hours.
Any books, notes and aids are permitted.
The following data leaf.txt
give the area in cm2 of 11 different leaves randomly sampled from a tree, and the number of insects on each leaf. We want to estimate the mean density of insects on the leaves, that is, the mean number of insects per cm2.
area count 1 2.0 8 2 1.4 4 3 2.5 4 4 4.0 5 5 4.4 13 6 12.2 18 7 11.6 27 8 7.9 19 9 17.0 33 10 23.1 42 11 22.0 43
(a) Using the simple estimator mean density = (total count)/(total area), find a point estimate and 95% confidence interval for the mean density. State your assumptions.
(b) Pick a distribution and link function to solve this as a GLM. Write out the estimating equations. Show that the MLE computed by GLM is just the simple estimator from (a) and show that the estimating equations can be solved in a single step, without iteration.
(c) Use GLM software to carry out the calculations. Test the adequacy of your fit with a chi-square test and with residual plots.
(d) Test the hypothesis that the mean density is 1 insect per cm2.
Put the file mydata.txt
into your R working directory and import it with mydata <- dget("mydata.txt")
. Fit a simple linear regression of y on x in the following ways and decide which is the best fit: (a) gamma error with canonical link, (b) normal error with canonical link, (c) normal error with inverse link. For (a) give an estimate of the gamma shape parameter; for (b) and (c) give an estimate of the normal variance.