STAT 516 hw 6

Author

Karl Gregory

Thirty sheets of paper were printed, each with one of the following instructions printed on top, such that each instruction appeared on five sheets of paper:

  1. “Draw a triangle”
  2. “Draw any triangle”
  3. “Draw literally any triangle”
  4. “Draw a three-sided shape”
  5. “Draw any three-sided shape”
  6. “Draw literally any three-sided shape”

The sheets of paper were stacked such that the instructions were inserted in the above order, cyclically, five times in the stack, and the sheets were handed out one-by-one to students in a class, such that the desk at which a student sat determined which instruction he or she was given. After following the instructions, the students were asked to measure the lengths of the sides (a, b, and c) of their shapes and record them. Twenty-two students attended the class, which resulted in an unbalanced design; to make the design balanced, two statistics graduate students were accosted in the hallway and asked to participate.

The data are in the file triangle_threesided_shape_draw.csv, which can be downloaded from this folder. The R code below will prepare the data for analysis: It will compute on each set of side lengths the value d, where d2 is defined as d2=(ab)2+(bc)2+(ac)23(a2+b2+c2). Thus d will be equal to zero if a triangle has equal sides (a=b=c), so triangles similar to equilateral triangles will have small values of d. The values of d will be used as the response in a two-way ANOVA model.

tri0 <- read.csv(pathtofile) # replace pathtofile 

a <- tri0$a
b <- tri0$b
c <- tri0$c
d <- sqrt(((a - b)^2 + (b - c)^2 + (a - c)^2 ) / (3*(a^2 + b^2 + c^2)))
tri <- data.frame(d,
                  F1 = as.factor(ifelse(tri0$F1=="threesided","thr","tri")),
                  F2 = as.factor(tri0$F2))
tri

Consider fitting the two-way treatment effects model which assumes the responses arise as Yijk=μ+τi+γj+(τγ)ij+εijk for k=1,,nij, i=1,,a, j=1,,b, where εijk are independent error terms having the N(0,σ2) distribution.

1.

What are the two factors in the experiment and how many levels does each have?

2.

Make side-by-side boxplots of the responses at all factor level combinations.

3.

Give the output of table(tri$F1,tri$F2) and explain what it shows.

4.

Give the means of the responses at all factor level combinations.

5.

Give σ^, the estimate of the standard deviation σ of the error terms.

6.

Check whether the assumptions of the two-way ANOVA model are satisfied.

7.

Give the value of the test statistic for the overall F test and the associated p value.

8.

Obtain the complete ANOVA table containing the F test statistics and associated p values for testing the significance of the main effects as well as the interaction effect.

9.

Generate interaction plots for the two factors. State whether you believe there is an interaction between the two factors.

10.

State whether you believe there is a significant main effect associated with any of the two factors.

11.

Use Dunnett’s method to compare the means at all factor level combinations to that of the “Draw a triangle” group. Report the confidence intervals for the differences in means and interpret them.