-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdescriptive_statistics.R
39 lines (32 loc) · 1010 Bytes
/
descriptive_statistics.R
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
library(dplyr)
dataset2 <- read.csv(file = "../Dataset_1_Quantitative_team.csv", na.strings = c("", " ", "No answer", "N/A"), header = TRUE)
#### Different nationalities and male/female ratio
dataset2 %>%
select(Nationality, Gender) %>%
group_by(Nationality) %>%
table()
#### Number of students of different nationalities
dataset2 %>%
select(Nationality, Gender) %>%
group_by(Nationality) %>%
tally(sort = TRUE)
#### How many people finished the survey all the way
dataset2 %>%
select(Last.page.seen) %>%
table()
#### Different courses and number of respondents for each course (highest number first)
dataset2 %>%
select(Course.name) %>%
group_by(Course.name) %>%
tally(sort = TRUE)
#### Courses with less than 10 respondents
dataset2 %>%
select(Course.name) %>%
group_by(Course.name) %>%
summarise(respondents = n()) %>%
filter(respondents < 10)
#### Graduated/not for different courses
dataset2 %>%
select(Course.name, Graduated) %>%
group_by(Course.name) %>%
table