---
title: "Rock fries your brains"
author: ""
date: ""
output:
  html_document:
    fig_height: 3
    fig_width: 5
  pdf_document:
    fig_height: 3
    fig_width: 5
  word_document:
    fig_height: 3
    fig_width: 5
---

```{r, setup, include=FALSE}
require(mosaic)   # Load additional packages here 

# Some customization.  You can alter or delete as desired (if you know what you are doing).
trellis.par.set(theme=theme.mosaic()) # change default color scheme for lattice
knitr::opts_chunk$set(
  tidy = FALSE,     # display code as typed
  size = "small")   # slightly smaller font for code
```

# The data

To read more about the dataset and see an explorative analysis have a look at the Rmarkdown file `rock-fries-your-brains.Rmd` in the exercises for the first lecture.


## Load data
In the data, missing values are coded as 999 (but this is handled by the command 
below that replace 999 by NA). Loading data:

```{r}
musik <- read.delim("https://asta.math.aau.dk/datasets?file=musik.txt", na.strings = "999")
```

# Change in performance

We will study the development of the performance of the mice from
week1 to week4:
```{r}
musik$devel <- musik$week4 - musik$week1
```

## Mozart

First, we will look at the "Mozart"-mice, which are coded `group==2`:
```{r}
Mozart <- subset(musik, group == 2)
```

The dataset Mozart only contains data for the "Mozart-mice".

We want to investigate whether or not their performance has changed
from week1 to week4.
```{r}
gf_boxplot(devel ~ "", data = Mozart) %>% gf_labs(x = "")
```

```{r}
t.test( ~ devel, data = Mozart)
```

What do you conclude?

## Anthrax

Make a similar analysis for the anthrax mice.

## Control

Make a similar analysis for the control mice.
