Friday, December 7, 2012
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.
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.
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.
The data for this assignment is corals.txt, a tab-delimited text file.
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.
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.
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.
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.
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.
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.
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 |