Stat 512 Spring 2008 Homework 7 Due: Friday March 21 2:00 1. In this question, we suppose that we can observe the true population mean ij for each of our subpopulations. We have 2 factors: A and B each with 3 levels. Subscript i refers to levels of A and Subscript j refers to levels of B. The true means are given in the following table: level B1 B2 B3 A1 3 5 5 A2 4 4 6 A3 12 14 14 a) What is the overall mean ()? b) What is the (average) effect of treatment A2 (2)? c) What is the (average) effect of treatment B3 (3)? d) What is ()23? e) What would 23 be if the treatments are additive (i.e. no interaction)? f) Sketch the 2 interaction diagrams. If one mean were changed, there would be no interaction - which mean is that? 2. Pine engraver beetle, Ips pini, is an insect mostly attacking trees that have been stressed. It is therefore an important pest in recently clear-cut forest areas. An experiment was conducted to determine the effects of host material and type of lure on trap catches of Ips pini. A factorial unbalanced experimental design consisting of three levels of factor type of lure and three levels of factor type of host material were used. The three levels for factor host material were: red pine (R), white pine (W), and white spruce (S). The three levels for factor type of lure were: chemical (A), a group of 20 male insects (B), and a control with no lure (C). Six-inch bolts of red pine, white pine, or white spruce were placed in an metal cage with wire screening, next to a Lindgren Funnel Trap. For lure treatment A, 0.1 mg of a synthetic mixture of 100:1 mixture of Ipsdienol:Lanierone was placed inside the cage. For lure treatment B, 20 live males were placed inside the cage. For treatment C, no lure was placed inside the cage. Treatment combinations of the two factors above were randomly assigned to 63 trapping cages. After 48 hours, the total number of beetles (males and females) caught in the Lindgren trap was counted. One trap was attacked by raccoons and hence the contents could not counted. Stat 512 Spring 2008 Data for this experiment are available on the course web page (Beetle trap). Save your output, as we will continue with this problem on the next homework. Answer the following questions: a. What is the factor effects model for this experiment? b. Use boxplots to determine whether you expect lure or host main effects and interactions. Discuss possible effects by reference to your plots. c. Fit the 2-way ANOVA model and determine whether the assumptions about the errors appear to be satisfied. d. Draw one of the two interaction plots. Interpret what you see in this plot. e. Conduct an analysis of variance to test whether or not the interaction between the two factors was statistically significant. f. Test whether or not the mean number of insects caught was the same for the three types of lure. g. Test whether or not the mean number of insects caught was the same for the 3 types of host material. h. Test whether or not the mean number of insects caught is the same for host R and S, if lure A is used. Use = 0.05. i. Test whether or not the mean number of insects caught is the same for host W lure A and for host S lure B. Use = 0.05. 3. In a classic agricultural experiment, an investigator looks at the yield of 5 varieties of corn (coded as character data) at 4 levels of nitrogen fertilizer. There are 2 replicates for each treatment. Yield is expected to have a quadratic relationship with nitrogen level, as too much nitrogen can have a deleterious effect on the plants. The data are available on the course web page as “Corn Data – Polynomial Effects”. There is an additional variable “rep” which is in the first column, which can be ignored for this homework. a. Fit the 2-way factorial ANOVA model to the data and test for variety by nitrogen interactions. Stat 512 Spring 2008 b. Fit an appropriate polynomial model, and test for lack of fit of an appropriate quadratic model in nitrogen. (“Appropriate” means considering interactions if these are present, and ignoring interactions if these are not present.”) c. State in words your conclusions about the relationships among nitrogen level, variety and yield. d. The investigator wants to pick an optimal level of nitrogen to achieve the best yield. Does it matter which variety she is using (among the varieties in this experiment)? e. Based on these data, what is your recommendation for the level of fertilizer to use? Briefly justify your answer. (Although we could attach a “p-value” to this, I am not asking for this – just use common sense.) SAS commands for 2-way ANOVA Y is response A and B are treatments ABplot is a variable with a unique value for each treatment – e.g. 100*A+B Since the treatments are both coded as character data, you can make a single variable by concatenating: e.g. ABplot= A||B; Since A is read in with lots of blanks, you might want to strip the blanks using TRIM ABplot=TRIM(A)||B; PROC SORT; BY ABplot B; Sorts the data for plotting. PROC BOXPLOT; levels of B. PLOT Y*ABplot (B); For each level of AB, produces a boxplot of Y split by PROC GLM; CLASS A B; MODEL Y=A B A*B; Fits full model. Produces F-test for interaction OUTPUT OUT=MYFILE STUDENT=R P=P; Stores residuals and fitted values. LSMEANS A*B; Prints yhat values for each treatment. Stat 512 LSMEANS A; MEANS A*B; MEANS A; ESTIMATE "NAME" A*B mu_ij values for each Spring 2008 Prints estimates of alpha_i values Prints sample means and s.d.s for each treatment Prints ybar_i. for each level of A. coefficients/E; Estimates a contrast in the treatment and prints the coefficients. ESTIMATE "NAME" A coefficients/E; Estimates a contrast in the alpha_i values for each treatment and prints the coefficients. PROC PLOT; PLOT P*A=B; PLOT P*B=A; Interaction plot with levels of A on the X-axis. Interaction plot with levels of B on the X-axis.