---
title: "F-tests"
output: html_document
---

```{r setup, include=TRUE, message=FALSE}
knitr::opts_chunk$set(echo = TRUE)
require(Sleuth3)
require(ggplot2)
require(tigerstats)
require(xtable)
require(lattice)

pyg = case1302
```

First, let's see that the F-test and the t-test are the same if we're talking about just one variable

```{r}
summary(lm(Score~Treat, data=pyg))
```


Now, let's add in more covariates, and see how the p-value goes up

```{r}
summary(lm(Score~Treat+Company, data=pyg))
```

```{r}
summary(lm(Score~Treat+Company+Treat*Company, data=pyg))
```

Of course, just because we can't reject the hypothesis that everything is 0 based on the F-test, doesn't mean everything is 0!



The output of ```anova(fit)``` compares the full model to the model with each group of indicators taken out. We can also do that explicitly

```{r}
fit_full <- lm(Score~Treat+Company+Treat*Company, data=pyg)
fit_reduced <- lm(Score~Treat+Company, data=pyg)
anova(fit_full, fit_reduced)
```

We can look that one up like this as well:
```{r}
anova(fit_full)
```



