---
title: "Ling 201, session 04: descr. stats 2 (class)"
author:
   - name: "[Stefan Th. Gries](https://www.stgries.info)"
     affiliation: "UC Santa Barbara & JLU Giessen"
     orcid: 0000-0002-6497-3958
date: "2027-01-26 12:34:56"
date-format: "DD MMM YYYY HH-mm-ss"
editor: source
format:
   html:
      page-layout: full
      code-fold: true
      code-link: true
      code-copy: true
      code-tools: true
      code-line-numbers: true
      code-overflow: scroll
      number-sections: true
      smooth-scroll: true
      toc: true
      toc-depth: 4
      number-depth: 4
      toc-location: left
      monofont: lucida console
      tbl-cap-location: top
      fig-cap-location: bottom
      fig-width: 6
      fig-height: 6
      fig-format: png
      fig-dpi: 300
      fig-align: center
      embed-resources: true
      include-in-header:
         text: '<link rel="shortcut icon" href="https://www.stgries.info/favicon.ico" type="image/x-icon" />'
execute:
   cache: false
   echo: true
   eval: true
   warning: false
---

```{r prepworkspace}
rm(list=ls(all=TRUE)); library(magrittr)
```

# Exercise 14

Ten bilingual students (English/German) took one dictation in English and one in German. They made the following numbers of mistakes in English and German respectively:

```{r exercise14}
ENGLISH <- c(29, 20, 10, 16, 12, 15, 25, 22, 20, 23)
GERMAN  <- c(21, 19, 28, 28, 26, 18, 16, 22, 20, 28)
```

a. Compute a measure of correlation to quantify the association between the numbers of errors.

```{r exercise14a}
# replace this with your answers/code
```

b. Illustrate the correlation in a graph and interpret the results (in one sentence).

```{r exercise14b}
# replace this with your answers/code
```

# Exercise 15

Compute the number of mistakes expected from a student in the German dictation, if that student made 12 mistakes in the English dictation.

```{r exercise15}
# replace this with your answers/code
```

# Exercise 16

Now you also obtained the sexes of the students: students 2 to 6 were girls, the rest boys.

a. Enter this into R.

```{r exercise16a}
# replace this with your answers/code
```

b. Compute the average numbers of errors in the German dictation for boys and girls.

```{r exercise16a}
# replace this with your answers/code
```

c. Represent the numbers of mistakes in the German dictation as a function of the sex of the students graphically.

```{r exercise16a}
# replace this with your answers/code
```

# Exercise 17

Standardize the numbers of errors in both dictations.

```{r exercise17}
# replace this with your answers/code
```

# Exercise 18

50 students took a statistics exam, 80% passed. What is the 95%-confidence interval for this result?

```{r exercise18}
# replace this with your answers/code
```

# Exercise 19

Load the file [_input/partplacement.csv](_input/partplacement.csv) into a data frame `d`. This file contains data from a corpus study on the alternation of particle placement that was introduced in Section 1.3; you can find information about this data set in [_input/partplacement.r](_input/partplacement.r).

```{r exercise19}
# replace this with your answers/code
```

# Exercise 20

Represent the correlation between the choice of construction and the complexity of the direct object graphically.

```{r exercise20}
# replace this with your answers/code
```

# Exercise 21

Create a table representing the correlation between the choice of construction and the complexity of the direct object and briefly summarize the result.

```{r exercise21}
# replace this with your answers/code
```

# Exercise 22

Represent the correlation between the choice of construction and the length of the direct object graphically and briefly summarize the result.

```{r exercise22}
# replace this with your answers/code
```

# Exercise 23

Investigate whether the choice of construction depends on the animacy of the referent of the direct objects and the presence/absence of a directional prepositional phrase.

```{r exercise23}
# replace this with your answers/code
```

# Session info

```{r sessionInfo}
sessionInfo()
```
