-
Notifications
You must be signed in to change notification settings - Fork 0
/
pengumpulan-data.qmd
142 lines (124 loc) · 4.63 KB
/
pengumpulan-data.qmd
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
title: "Pengumpulan Data"
author: "Yosep Dwi Kristanto"
format: html
editor: visual
---
```{r}
#| include: false
library(tidyverse)
library(readxl)
library(countrycode)
```
## Rerata dan Variasi Skor Matematika
```{r}
#| warning: false
#| message: false
rerata_var_matematika <- read_excel("set-data/xmrlsh.xlsx",
sheet = "Table I.B1.2.1", skip = 8, n_max = 84) %>%
rename(negara = ...1,
skor_rerata = `Mean score`,
se_rerata = S.E....3,
sd = S.D.,
se_sd = S.E....5,
skor_10 = Score...6,
se_10 = S.E....7,
skor_25 = Score...8,
se_25 = S.E....9,
skor_50 = Score...10,
se_50 = S.E....11,
skor_75 = Score...12,
se_75 = S.E....13,
skor_90 = Score...14,
se_90 = S.E....15,
selisih_90_10 = `Score dif.`,
se_selisih_90_10 = S.E....17) %>%
filter(!negara %in% c("OECD", "Partners")) %>%
mutate(negara = gsub("\\*", "", negara)) %>%
mutate(negara = ifelse(negara == "Baku (Azerbaijan)", "Azerbaijan", ifelse(negara == "Ukrainian regions (18 of 27)", "Ukraine", ifelse(negara == "Macao (China)", "Macau", ifelse(negara == "Hong Kong (China)", "Hong Kong", ifelse(negara == "OECD average", "OECD", negara)))))
) %>%
mutate(iso3c = ifelse(negara == "Kosovo", "XKK",
ifelse(negara == "OECD", "ECD",
countrycode(negara, origin = "country.name",
destination = "iso3c")))) %>%
relocate(iso3c, .before = negara) %>%
mutate(mapel = "Matematika") %>%
relocate(mapel, .after = negara)
head(rerata_var_matematika)
```
```{r}
#| warning: false
#| message: false
rerata_var_baca <- read_excel("set-data/xmrlsh.xlsx",
sheet = "Table I.B1.2.2", skip = 8, n_max = 84) %>%
rename(negara = ...1,
skor_rerata = `Mean score`,
se_rerata = S.E....3,
sd = S.D.,
se_sd = S.E....5,
skor_10 = Score...6,
se_10 = S.E....7,
skor_25 = Score...8,
se_25 = S.E....9,
skor_50 = Score...10,
se_50 = S.E....11,
skor_75 = Score...12,
se_75 = S.E....13,
skor_90 = Score...14,
se_90 = S.E....15,
selisih_90_10 = `Score dif.`,
se_selisih_90_10 = S.E....17) %>%
filter(!negara %in% c("OECD", "Partners")) %>%
mutate(negara = gsub("\\*", "", negara)) %>%
mutate(negara = ifelse(negara == "Baku (Azerbaijan)", "Azerbaijan", ifelse(negara == "Ukrainian regions (18 of 27)", "Ukraine", ifelse(negara == "Macao (China)", "Macau", ifelse(negara == "Hong Kong (China)", "Hong Kong", ifelse(negara == "OECD average", "OECD", negara)))))
) %>%
mutate(iso3c = ifelse(negara == "Kosovo", "XKK",
ifelse(negara == "OECD", "ECD",
countrycode(negara, origin = "country.name",
destination = "iso3c")))) %>%
relocate(iso3c, .before = negara) %>%
mutate(mapel = "Membaca") %>%
relocate(mapel, .after = negara)
head(rerata_var_baca)
```
```{r}
#| warning: false
#| message: false
rerata_var_sains <- read_excel("set-data/xmrlsh.xlsx",
sheet = "Table I.B1.2.3", skip = 8, n_max = 84) %>%
rename(negara = ...1,
skor_rerata = `Mean score`,
se_rerata = S.E....3,
sd = S.D.,
se_sd = S.E....5,
skor_10 = Score...6,
se_10 = S.E....7,
skor_25 = Score...8,
se_25 = S.E....9,
skor_50 = Score...10,
se_50 = S.E....11,
skor_75 = Score...12,
se_75 = S.E....13,
skor_90 = Score...14,
se_90 = S.E....15,
selisih_90_10 = `Score dif.`,
se_selisih_90_10 = S.E....17) %>%
filter(!negara %in% c("OECD", "Partners")) %>%
mutate(negara = gsub("\\*", "", negara)) %>%
mutate(negara = ifelse(negara == "Baku (Azerbaijan)", "Azerbaijan", ifelse(negara == "Ukrainian regions (18 of 27)", "Ukraine", ifelse(negara == "Macao (China)", "Macau", ifelse(negara == "Hong Kong (China)", "Hong Kong", ifelse(negara == "OECD average", "OECD", negara)))))
) %>%
mutate(iso3c = ifelse(negara == "Kosovo", "XKK",
ifelse(negara == "OECD", "ECD",
countrycode(negara, origin = "country.name",
destination = "iso3c")))) %>%
relocate(iso3c, .before = negara) %>%
mutate(mapel = "Sains") %>%
relocate(mapel, .after = negara)
head(rerata_var_sains)
```
```{r}
hasil_belajar <- rbind(rerata_var_matematika,
rerata_var_baca,
rerata_var_sains)
write_csv(hasil_belajar, file = "set-data/hasil_belajar.csv")
```