-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_analyse.Rmd
71 lines (55 loc) · 1.44 KB
/
05_analyse.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: "Beispielauswertung"
author: "Peter Popel"
output:
html_document:
theme: spacelab
toc: yes
toc_float: true
---
Das hier ist eine Beispielauswertung für den Datensatz `ngo`.
## Datensatz einlesen und packages laden
```{r, message=FALSE, warning=FALSE}
library(ggplot2)
library(dplyr)
library(tadaatoolbox)
library(sjPlot)
library(sjmisc)
ngo <- readRDS("data/ngo.rds")
```
## Datensatzbeschreibung
```{r descriptives}
descr(ngo)
```
## Beziehung zwischen **Urteil** und **Leistung**
```{r}
sjt.xtab(ngo$urteil, ngo$leistung)
tadaa_ord(ngo$urteil, ngo$leistung, print = "markdown")
```
Oder als Scatterplot:
```{r}
ggplot(data = ngo, aes(x = urteil, y = leistung)) +
geom_point() +
geom_smooth(method = lm, se = FALSE, color = "red") +
labs(title = "Scatterplot von Urteil und Leistung",
subtitle = "Lineare Beziehung mit Regressionsgerade",
x = "Urteil", y = "Leistung") +
theme_tadaa()
```
## Geschlecht und Urteil
```{r}
ngo %>%
group_by(geschl) %>%
summarize(mean = mean(urteil),
median = median(urteil),
IQR = IQR(urteil),
sd = sd(urteil))
ggplot(data = ngo, aes(x = geschl, y = urteil, fill = geschl)) +
geom_boxplot(alpha = .5) +
scale_y_continuous(breaks = pretty) +
scale_fill_brewer(palette = "Set1", guide = FALSE) +
labs(title = "Urteil nach Geschlecht",
subtitle = "Boxplots",
x = "Geschlecht", y = "Urteil") +
theme_tadaa()
```