---
title: "dag3"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r}
vet <- read.table("~/ku/undervisning/puff/slides/2018/day3/data/veteraner.txt", header=TRUE)
m3 <- lm(fev1 ~ ryger*alder, data=vet)
library("MESS")
residualplot(m3)
#wallyplot(m3)

```

 # Opgaven
 
```{r}
library("stat4med")
data(fev)
m1 <- lm(FEV ~ Smoke, data=fev)
library("broom")
m1 %>% tidy()

m2 <- lm(FEV ~ Smoke + Age, data=fev)
m2 %>% tidy()

DF <- data.frame(Age=c(12, 12), Smoke=c("Yes", "No"))
predict(m2, newdata=DF)

m3  <- lm(FEV ~ Smoke + Age*Gender, data=fev)
m3 %>% tidy()



```
 
 