---
title: "Uge4"
output: html_document
---

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

## Opgave 1

```{r}
prop.test(50, 80)
50/80
help(prop.test)
prop.test(50, 80, p=0.65)

```


## Opgave 2

```{r}
# Titanic eksempel
m <- matrix(c(367, 344, 1364, 126), 2)
m

# Opgaven 

p40 <- 21/(21 + 255)
p30 <- 70/(70 + 3825)

rd <- p40 - p30
rd

p40/p30

m <- matrix(c(21, 70, 255, 3825), 2)
m

chisq.test(m)

21/255 / ( 70/3825)

fisher.test(m)

```




## Opgave 3

```{r}
m <- matrix(c(547, 458, 552, 236, 365, 395, 304, 261, 117, 301, 251, 212, 165, 80, 127), 5)

m

chisq.test(m)

```

