Stat 705 HW 19 Due Monday April 7, 2008. --------------------------------------- Consider the R dataset OrchardSprays which can be found in the base R package. Use help(OrchardSprays) to get some background on what the dataset was measuring. Then do the following task in both R (with the lm() function, defining factor predictors with defined contrasts or with design-matrix columns defined directly) and SAS (with either PROC REG, or more simply, with PROC GLM using the CLASS statement to work with dummy variables without having to code them yourself in a DATA step). PROBLEM: Since the levels A,B,...,G,H correspond to an increasing concentration of applied chemical, an interesting set of parameters to estimate is the difference betweeen the average response with treatment B versus treatment A, treatment C versus treatment B, D versus C, etc., through G versus F. Note that the "response" variable "decrease" is a measure of the volume of sugared water that the bees absorb, so larger values correspond to a less effective treatment (because fewer bees have been repelled when more sugared water is used up.) Estimate the parameters mu_B-mu_A, mu_C-mu_B, etc., and give the estimated (7x7) variance-covariance matrix of your estimates. Use the resulting estimates and estimated variances [or the software's reported hypothesis tests about contrasts] to perform 7 separate hypothesis tests to find whether B is less effective than A in honeybee repulsion (i.e., mu_B-mu_A>0), whether C is less effective than B, etc., all the way through whether H is less effective than G. NOTE: see the new (as of 4/5/08) handout Contr.txt under the Handouts portion of the course web-page for further elaboration on how to define customized contrasts. EXTRA: in either R OR SAS [you need not do this part in both packages], fit an augmented model incorporating the mean treatment effect parameters as above together with the binary parameter: I{rowpos > 3). Show that this extra parameter is highly significant, and with this parameter in the model re-examine which contrasts B vs. A, C vs. B, ..., H vs. G are [individually] significant.