---
title: "Spock Trial"
output: html_document
---

```{r setup, include=TRUE, message=FALSE}
knitr::opts_chunk$set(echo = TRUE)
require(Sleuth3)
require(tigerstats)
spock <- transform(case0502, Judge = factor(Judge, levels = c("Spock's", "A", "B", "C", "D", "E", "F")))
```

## Spock Conspiracy Trial

In this dataset, we have the percentage of women on venires for different judges, including a judge who presided over the trial of [Benjamin Spock](https://en.wikipedia.org/wiki/Benjamin_Spock). We are interested to know whether Spock's judge had fewer women in his venires than other judges.

Here's a boxplot

```{r}
bwplot(Percent ~ Judge, data = spock) 
```


Here's the t-test:

```{r}
notspock <- subset(spock, Judge != "Spock's")
onlyspock <- subset(spock, Judge == "Spock's")
t.test(notspock$Percent, onlyspock$Percent, var.equal=TRUE)
```

Now, let's run ANOVA with just the indicator variable for Spock's trial as an indicator.

```{r}
spock$SPOCKJUDGE <- spock$Judge == "Spock's"
anova(lm(Percent~SPOCKJUDGE, data=spock))
```



