---
title: "Ling 201, session 03: descr. stats 1 (class)"
author:
   - name: "[Stefan Th. Gries](https://www.stgries.info)"
     affiliation: "UC Santa Barbara & JLU Giessen"
     orcid: 0000-0002-6497-3958
date: "2027-01-19 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 01

Compute the mean of the following numbers: 1, 2, 4, 8, 10, 12.

```{r exercise01}
# replace this with your answers/code
```

# Exercise 02

Based on their performance in a test, students were awarded the following grades (1=best, 6=worst):

```{r exercise02}
grades.in.test<-rep(      # repeat=
   1:6,                   # the numbers from 1 to 6
   c(2, 15, 10, 4, 4, 2)) # this many times respectively
```

a. Compute the most appropriate measure of central tendency.

```{r exercise02a}
# replace this with your answers/code
```

b. Compute the most appropriate measure of dispersion.

```{r exercise02b}
# replace this with your answers/code
```

c. Represent the result graphically in a bar plot.

```{r exercise02d}
# replace this with your answers/code
```

# Exercise 03

Load the file [_input/disfluencies.csv](_input/disfluencies.csv) into a data frame `d`; you can find information about this data set in [_input/disfluencies.r](_input/disfluencies.r).

```{r exercise03}
# replace this with your answers/code
```

# Exercise 04

Determine how many fillers/disfluencies occurred in each genre.

```{r exercise04}
# replace this with your answers/code
```

# Exercise 05

Represent in a graph how many fillers/disfluencies occurred in each genre.

```{r exercise05}
# replace this with your answers/code
```

# Exercise 06

Was the 990th disfluency produced by a man or a woman?

```{r exercise06}
# replace this with your answers/code
```

# Exercise 07

Generate separate summary statistics for the lengths in each of the two genres.

```{r exercise07}
# replace this with your answers/code
```

# Exercise 08

Determine how many fillers/disfluencies are longer than the average of all disfluencies.

```{r exercise08}
# replace this with your answers/code
```

# Exercise 09

Determine who produces more of the fillers/disfluencies that are longer than the average of all disfluencies, men or women.

```{r exercise09}
# replace this with your answers/code
```

# Exercise 10

What does this do? (If you cannot see that immediately from the plot, execute the function without the `barplot` plotting part.)

```{r exercise10}
#| eval: false
barplot(prop.table(table(x$FILLER, x$GENRE),2))
```

# Exercise 11

Sort the data frame `d`

* according to the factor `SEX` (ascending) and, within `SEX`,
* according to the disfluencies/`FILLER` (descending) and, within the disfluencies/`FILLER`,
* according to the lengths of the fillers/disfluencies (ascending).

```{r exercise11}
# replace this with your answers/code
```

# Exercise 12

Compute the proportions of the three fillers/disfluencies, their 95% confidence intervals, and discuss briefly what the confidence intervals suggest concerning the different frequencies of the fillers/disfluencies.

```{r exercise12}
# replace this with your answers/code
```

# Exercise 13

Compute the average positions in sentences for the three fillers/disfluencies, their 95% confidence intervals, and discuss briefly what the confidence intervals suggest concerning the different average positions of the fillers/disfluencies.

```{r exercise13}
# replace this with your answers/code
```

# Session info

```{r sessionInfo}
sessionInfo()
```
