-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurvey_responses.qmd
254 lines (216 loc) · 8.11 KB
/
survey_responses.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
---
title: "Survey Responses"
execute:
echo: false
---
Programatically wrangle and visualize responses from Fall workshop series survey.
::: callout-warning
This script will need modification if the questions in the survey are modified!
:::
```{r setup}
#| include: false
library(googlesheets4)
library(tidyverse)
```
```{r read}
#| include: false
id <- "17qYb67tSPDO_1hqlBJ-B563DvuB2PFoxBFVA9MRcU5E"
responses_raw <- read_sheet(id, sheet = 1, col_types = "c")
```
```{r colnames}
questions <- colnames(responses_raw)
# questions
colnames(responses_raw) <-
questions |>
str_replace("Timestamp", "datetime") |>
str_replace("Which workshop series did you attend\\?", "year") |>
str_replace("How many sessions did you attend synchronously\\?", "num_sync") |>
str_replace("How many sessions did you attend asynchronously\\?", "num_async") |>
str_replace("Please enter a unique identifier as follows: Number of siblings \\(as numeric\\) \\+ First two letters of the city you were born in \\(lowercase\\) \\+ First three letters of your current street \\(lowercase\\)\\.", "id") |>
str_replace("Which department are you affiliated with\\?", "department") |>
str_replace("If you answered 'Other' in the previous question, write your department name below\\.", "department_other") |>
str_replace("On a scale of 1 to 5, what was your ability to complete the following tasks prior to the workshop: ", "pre_ability_") |>
str_replace("On a scale of 1 to 5, what was your level of understanding while completing the following tasks prior to the workshop \\(if you could not do the task at all, select option 1\\): ", "pre_understand_") |>
str_replace("On a scale of 1 to 5, what is your ability to complete the following tasks now: ", "post_ability_") |>
str_replace("On a scale of 1 to 5, what is your level of understanding about these tasks now \\(if you can not do the task at all, select option 1\\): ", "post_understand_") |>
str_replace("\\[Navigate around filesystem using shell commands\\]", "shell") |>
str_replace("\\[Use relative/absolute files paths to change working directory\\]", "paths") |>
str_replace("\\[Track changes to code using git\\]", "git") |>
str_replace("\\[Share your code using a GitHub repo\\]", "githubShare") |>
str_replace("\\[Use someone else's code from GitHub\\]", "githubUse") |>
str_replace("\\[Organize and name files/folders for a research project\\]", "compendium") |>
str_replace("\\[Remove rows from dataset based on criteria \\(e.g., NAs\\)\\]", "filter") |>
str_replace("\\[Reformat dataset from wide to long \\(e.g., for plotting\\)\\]", "pivot") |>
str_replace("\\[Write your own R function\\]", "function") |>
str_replace("\\[Repeat a task efficiently with a for loop\\]", "iterate") |>
str_replace("\\[Describe project repository with a README.md\\]", "readme") |>
str_replace("\\[Combine descriptive text and R code using Quarto\\]", "quarto") |>
str_replace("Which of the following tools that we covered during the workshop have you already incorporated into your research that you were not using prior to the workshop\\?", "useAlready") |>
str_replace("Which of the following tools that we covered during the workshop do you plan to incorporate into your research within six months after the last workshop session\\?", "usePlanned") |>
str_replace("If you selected any of the options in the previous question, please give one concrete example of how you will implement one of these tools in your research\\.", "useExample") |>
str_replace("Please share one suggestion you have for improving this workshop series\\.", "suggestion") |>
str_replace("What topics would you like to see included in future workshops\\?", "futureTopics")
names(questions) <- colnames(responses_raw)
# questions
question_legend <- enframe(questions) |>
rename(colname = name, question_long = value) |>
filter(str_starts(colname, "(pre|post)_")) |>
separate(colname, into = c("pre_post", "ability_understand", "question"),
sep = "_") |>
mutate(question_short = question_long |>
str_remove("On a scale of 1 to 5, .+: ") |>
str_remove_all("[\\[\\]]"))
```
```{r format}
responses <- responses_raw |>
mutate(department = if_else(department == "Other", department_other, department)) |>
select(-department_other) |>
mutate(across(c(year, starts_with("num_"), starts_with("pre_"), starts_with("post_")), parse_number))
```
#### Question Legend
```{r}
question_legend |>
summarize(question = first(question), question_short = first(question_short), .by = question) |>
knitr::kable()
```
```{r}
resp_likert <-
responses |>
select(year, starts_with("pre_"), starts_with("post_")) |>
pivot_longer(-year, names_sep = "_", names_to = c("pre_post", "ability_understand", "question"), values_to = "score") |>
summarize(score_median = median(score), n = n(), .by = c(year, pre_post, ability_understand, question)) |>
mutate(pre_post = factor(pre_post, levels = c("pre", "post"))) |>
mutate(question = fct_inorder(question))
```
## 2022 (n = `r nrow(filter(responses, year == 2022))`)
### Pre vs. post self-assessment
```{r}
resp_likert |>
filter(year == 2022, ability_understand == "ability") |>
ggplot(aes(x = question, y = score_median, fill = pre_post)) +
geom_col(position = "dodge") +
labs(
title = "2022 Self-Rated Ability",
fill = "pre/post workshop",
y = "Median Score (1-5)",
x = ""
)+
theme(axis.text.x.bottom = element_text(angle = 45, hjust = 1))
```
```{r}
resp_likert |>
filter(year == 2022, ability_understand == "understand") |>
ggplot(aes(x = question, y = score_median, fill = pre_post)) +
geom_col(position = "dodge") +
labs(
title = "2022 Self-Rated Understanding",
fill = "pre/post workshop",
y = "Median Score (1-5)",
x = ""
)+
theme(axis.text.x.bottom = element_text(angle = 45, hjust = 1))
```
### Free Response
```{r}
#| output: asis
cat("#### ", questions[["useAlready"]])
```
```{r}
responses |>
filter(year == 2022) |>
select(useAlready) |>
separate_longer_delim(useAlready, delim = ", ") |>
count(useAlready) |>
arrange(desc(n)) |>
knitr::kable()
```
```{r}
#| output: asis
cat("#### ", questions[["usePlanned"]])
```
```{r}
responses |>
filter(year == 2022) |>
select(usePlanned) |>
separate_longer_delim(usePlanned, delim = ", ") |>
count(usePlanned) |>
arrange(desc(n)) |>
knitr::kable()
```
```{r}
#| output: asis
cat("#### ", questions[["useExample"]])
```
```{r}
#| output: asis
ex2022 <- responses |>
filter(year == 2022) |>
pull(useExample)
glue::glue("- {ex2022}")
```
## 2023 (n = `r nrow(filter(responses, year == 2022))`)
### Pre vs. post self-assessment
```{r}
resp_likert |>
filter(year == 2023, ability_understand == "ability") |>
ggplot(aes(x = question, y = score_median, fill = pre_post)) +
geom_col(position = "dodge") +
labs(
title = "2023 Self-Rated Ability",
fill = "pre/post workshop",
y = "Median Score (1-5)",
x = ""
)+
theme(axis.text.x.bottom = element_text(angle = 45, hjust = 1))
```
```{r}
resp_likert |>
filter(year == 2023, ability_understand == "understand") |>
ggplot(aes(x = question, y = score_median, fill = pre_post)) +
geom_col(position = "dodge") +
labs(
title = "2023 Self-Rated Understanding",
fill = "pre/post workshop",
y = "Median Score (1-5)",
x = ""
)+
theme(axis.text.x.bottom = element_text(angle = 45, hjust = 1))
```
### Free Response
```{r}
#| output: asis
cat("#### ", questions[["useAlready"]])
```
```{r}
responses |>
filter(year == 2023) |>
select(useAlready) |>
separate_longer_delim(useAlready, delim = ", ") |>
count(useAlready) |>
arrange(desc(n)) |>
knitr::kable()
```
```{r}
#| output: asis
cat("#### ", questions[["usePlanned"]])
```
```{r}
responses |>
filter(year == 2023) |>
select(usePlanned) |>
separate_longer_delim(usePlanned, delim = ", ") |>
count(usePlanned) |>
arrange(desc(n)) |>
knitr::kable()
```
```{r}
#| output: asis
cat("#### ", questions[["useExample"]])
```
```{r}
#| output: asis
ex2023 <- responses |>
filter(year == 2023) |>
pull(useExample)
glue::glue("- {ex2023}")
```