---
title: "MATH-650 Assignment 10"
author: 'Saket Choudhary (USCID: 2170058637) (skchoudh@usc.edu)'
date: "11/04/2015"
output:
  pdf_document: default
  html_document:
    keep_md: yes
  word_document: default
---

# Chapter 13: 12

```{r}
data <- read.csv('case1301.csv')
data$Cover <- data$Cover/100
data$Cover <- log(data$Cover/(1-data$Cover))
grandmean <- mean(data$Cover)
agg <- aggregate(Cover ~ Treat, data, mean)
agg

```

```{r}
agg1 <- aggregate(Cover ~ Treat + Block, data, mean)
agg1
```

### Part (a)
```{r}
means <- agg$Cover
variance <- var(means)
variance
```

```{r}
16*variance
```

which is what is in Display 13.11


### Part (b)

```{r}
#block.averages <- c(-2.64, -2.18, -.53, .34, -1.42, -.61, -1.53, -1.31)
agg2 <- aggregate(Cover ~ Block, agg1, mean)
variance.block.averages <- var(agg2$Cover)
agg2
```

```{r}
12*variance.block.averages 
```

which is same as what is in Display 13.11


### Part (c)

```{r}
cell48.variance <- var(agg1$Cover)
2*cell48.variance
```
which is same as model mean square  in Display 13.10

### Part (d)

```{r}
fit <- aov(Cover ~ Treat + Block + Block*Treat, data=data)
s <- summary(fit)
s
```

```{r}
block.ss <- 76.2386
treatment.ss <- 96.9932
interaction.ss <- 15.2304
between.ss <- 188.4622
between.ss - (block.ss+treatment.ss)
```

which is the same as `interaction.ss`(interaction sum of squares)

