Final Exam—Part 1

Due Date

Friday, December 7, 2012

Instructions

Same rules and policies apply to this "exam" as apply to ordinary assignments. Part 2 of the final will be assigned before the last day of class and will be due on Monday, December 10.

Problem 1

Data Source

The data for this assignment are contained in bycatch.csv, a comma-delimited text file. This is the same data set you analyzed in Assignment 10.

Background

In Question 8 of Assignment 10 you were asked to provide statistical evidence to determine if log(Tows) should be included in the regression model as an offset with a coefficient fixed at 1 or as a covariate with an estimated coefficient. What you should have discovered was that AIC favored treating log(Tows) as a covariate, a Wald test favored treating log(Tows) as a covariate, but a likelihood ratio test favored treating log(Tows) as an offset. Because the validity of both the likelihood ratio statistic and the Wald statistic depend on asymptotic results and the bycatch data set is not particularly large, it's not obvious what to do here. This problem attempts to shed light on this question using Bayesian methods.

Questions

  1. Use Bayesian methods to fit the final bycatch model from Assignment 10 in which log(Tows) is treated as a covariate and season is included as a random effect. Report your BUGS program as well as the standard summary table returned by JAGS or WinBUGS.
  2. To determine if log(Tows) can legitimately be treated as an offset in this model report a relevant percentile credible interval and an HPD credible interval. What do you conclude?

Problem 2

Data Source

The data for this assignment is corals.txt, a tab-delimited text file.

Background

This data set contains the results of an experiment set up to determine the effect of temperature on the growth rates of corals. The variables contained in the data set are the following.

  1. tank: identifies the three different aquaria that serve as replicates for a given temperature treatment. This identifier is not unique.
  2. temp: is the temperature that a particular aquarium was maintained at for the duration of the experiment. Three temperature levels were used: 25°C, 28°C, and 32°C.
  3. incr: the gain in dry mass (g) experienced by a coral over one time period.
  4. id: an identifier that uniquely identifies the different coral animals used in the experiment.
  5. surf.area: the surface area of the individual corals (cm2) at the start of the experiment.
  6. tank.grp: a unique identifier that identifies the nine different aquaria used in the experiment.
  7. inctime: the length of time (days) over which the mass gain (incr) occurred.
  8. rate: this is the growth rate, the mass gain (incr) divided by time (inctime) reported in mg/day.
  9. time.period: identifies the time period of the growth. It is numbered 1, 2, and 3 to correspond to the first, second, and third growth rate measurements for a given animal.

Because of logistical difficulties it was not possible to measure all 162 coral animals on the same day. So, the length of the observational periods varied slightly for some of the animals from different aquaria. To account for this growth increments were divided by the corresponding time interval to yield a growth rate. All analyses were carried out on the growth rates.

It was suspected that there might be some latency effects of temperature. In particular it was thought that there would be an initial adjustment period during which the animals acclimated to their aquaria after which the animals would begin to exhibit their true response to temperature. So a linear relationship between growth and time was not expected. As a result it was decided to treat time as a categorical variable (time.period) in this analysis.

Important features of the experimental design

  1. There are nine aquaria and each aquarium contained 18 different coral animals.
  2. Growth rates were obtained for each coral animal at three different time points in the study yielding 3 × 18 × 9 = 486 observations. At each time point the growth rate was calculated as the change in dry mass of the animal since the last measurement divided by the length of time. The first growth rate was obtained as the change from the animal's initial dry mass (a value that is not reported in the data you are given).
  3. Temperature treatments were randomly assigned to aquaria so that there were three aquaria (replicates) at each temperature. The same temperature was maintained in that aquarium for the duration of the experiment. The nine different aquaria used in the experiment are uniquely identified by the variable tank.grp.
  4. Although effort was made to choose coral animals of roughly the same initial size, this turned out to be impossible. It is suspected that an animal's size might affect its growth rate over time or its response to temperature or both. Because an animal's initial surface area was thought to be a more useful predictor than its initial mass, surface area (cm2) is reported in the data set for each animal at the beginning of the study.

The primary objective of this exercise is to determine how an animal's growth rate changes over time and to determine if the nature of that change varies with temperature. This needs to be done in a way that controls for any confounding variables while properly accounting for the experimental design.

Questions

  1. Identify as many of the important statistical design features of this experiment that you can. Be sure to use the language we've presented in this course when naming these design features.

Hint 1: There are at least three distinct design features you could mention here.
Hint 2: The basic research question here is whether the average growth rate (rate) is different at different temperatures (temp). Without any design complications it would seem that this question could be addressed with a one-way analysis of variance, or perhaps a two-way ANOVA with temperature and time as potentially interacting factors. Because of the way the experiment was designed such simple analyses are inappropriate. The design features I'm referring to each individually force the analysis to deviate from an ordinary ANOVA in specific ways. If it were possible to add these design features sequentially each addition would cause us to change the form or type of model that we are fitting from what it was without it.

  1. Fit a sensible starting model for this experiment that properly accounts for all the design features you mentioned in Question 1.

Hint: Some of the factor variables have numeric codes for their categories. Don't slip up and treat these variables as numeric in your model. You don't know that the growth rate is monotonic with temperature or with time.

  1. Simplify the model you fit in Question 2 so that all the remaining terms are statistically significant.
  2. Obtain estimates of the mean growth rates during each time period separately by temperature and obtain 95% confidence intervals for the means. Carry out these calculations for a typical coral animal with an initial surface area of 10 cm2, a value that is close to the mean initial size of animals used in the study.

Hint 1: Sometimes a convenient way to fit a model so that the estimated mean corresponds to a specific value of a covariate is to center the covariate at that value when you fit the model. This is particularly convenient here when coupled with Hint 2 because it allows you to ignore some of the "nuisance" terms in your final model when obtaining confidence intervals for the terms you care about.
Hint 2: You might also consider using the trick in which you leave out selected terms from the model causing R to estimate the same model but with a different parameterization. If you do this the right way you can then easily obtain the confidence intervals for the means you need using a standard function for this type of model. The model you want has only the two 2-factor interactions in it and nothing else (no intercept, no main effects). Also, to get this to work you need to list as the first term in this model the interaction term whose values correspond to the individual estimates you want. The nuisance interaction term (the one that will drop out when surface area = 10) should be second. Be sure to verify that the model you get has the same AIC as the regularly parameterized final model.
Hint 3: It's also possible to use the effects package to obtain the means and confidence intervals you need here. You will need to use the given.values argument to specify the value of surface area.
Hint 4: You can also set up a contrast matrix and get the standard errors with a sandwich expression involving the variance-covariance matrix.

  1. Prepare a suitable graph that shows the individual treatment means and the confidence intervals that you calculated in Question 4 and permits easy comparison of the effect of temperature on the mean growth rates over time.

Course Home Page


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--December 6, 2012
URL: https://sakai.unc.edu/access/content/group/3d1eb92e-7848-4f55-90c3-7c72a54e7e43/public/docs/assignments/finalpart1.htm