-
Notifications
You must be signed in to change notification settings - Fork 1
/
survey.qmd
489 lines (350 loc) · 9.91 KB
/
survey.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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
---
format: html
echo: false
warning: false
---
```{r}
library(surveydown)
```
::: {#welcome .sd-page}
# Demo survey of choice-based-conjoint questions
::: {.callout-note}
This is a demo survey showcasing the functionality of <a href="https://surveydown.org" target="_blank">surveydown</a>. It doesn't collect any data.
The GitHub repo of this demo can be accessed <a href="https://github.com/surveydown-dev/demo-choice-based-conjoint" target="_blank">here</a>.
:::
This is a demo of choice-based-conjoint survey. For this survey, we will ask you about your preferences for different types of apples.
```{r}
sd_next()
```
:::
::: {#consent .sd-page}
# Consent
This survey is being conducted by students at The George Washing University. We will not be collecting any identifying data, such as your name or address. The whole survey will take approximately 10 to 15 minutes to complete. Your participation is voluntary and you may stop the survey at any time.
If you would like to participate, please answer the following questions:
```{r}
sd_question(
type = 'mc',
id = 'consent_age',
label = "I am age 18 or older",
option = c(
'Yes' = 'yes',
'No' = 'no'
)
)
sd_question(
type = 'mc',
id = 'consent_understand',
label = "I have read and understand the above information",
option = c(
'Yes' = 'yes',
'No' = 'no'
)
)
sd_next()
```
:::
::: {#favorite_fruit .sd-page}
# Favorite Fruit
```{r}
sd_question(
type = 'mc',
id = 'like_fruit',
label = "Do you like fruit?",
option = c(
'Yes!' = 'yes',
'Kind of' = 'kind_of',
'No :(' = 'no'
)
)
sd_question(
type = 'text',
id = 'fav_fruit',
label = "What is your favorite fruit?"
)
sd_next()
```
:::
::: {#screening .sd-page}
# Screening Questions
For this example, I'm using the response here to screen out respondents - I'm only interested in people who choose **"Red"**, so if you choose "Blue" you'll be screened out.
Usually you would not tell respondents ahead of time how they will be screened - I'm just putting an explanation here since this whole survey is for demonstration purposes
```{r}
sd_question(
type = 'mc',
id = 'screenout',
label = "Before we go on, please select which color you prefer between these two:",
option = c(
'Blue' = 'blue',
'Red' = 'red'
)
)
sd_next()
```
:::
::: {#educational .sd-page}
# Educational Page
Great work!
Now that you've shared a bit about yourself, we'd like you to consider a shopping scenario in which you can choose some apples to purchase from a set of apples with different attributes.
Let's learn about these attributes.
## Price
Price refers to the full price you will pay (including taxes) for the apples
## Freshness
The freshness of the apple will be presented as one of three different categories:
- **Excellent**: No bruising or marks.
- **Average**: One or two light bruises.
- **Poor**: Multiple bruises and marks.
## Type
We will show five different types of apples:
<div style="width: 500px;">
Fuji | Gala | Honeycrisp | Pink Lady | Red Delicious
-----|------|------------|-----------|--------------
<img src="images/fuji.jpg" width=100> | <img src="images/gala.jpg" width=100> | <img src="images/honeycrisp.jpg" width=100> | <img src="images/pinkLady.jpg" width=100> | <img src="images/redDelicious.jpg" width=100>
</div>
```{r}
sd_next()
```
:::
::: {#cbc_practice .sd-page}
# Choice-based Conjoint (cbc) Practice
We'll now begin the choice tasks. On the next few pages we will show you three options of apples and we'll ask you to choose the one you most prefer.
```{r}
# Define the option vector
apple_buttons_option <- c("option_1", "option_2", "option_3")
# Change the names of each element to display markdown-formatted
# text and an embedded image using html
names(apple_buttons_option)[1] <- "
**Option 1**<br>
<img src='images/fuji.jpg' width=100><br>
**Type**: Fuji<br>
**Price**: $ 2 / lb<br>
**Freshness**: Average
"
names(apple_buttons_option)[2] <- "
**Option 2**<br>
<img src='images/pinkLady.jpg' width=100><br>
**Type**: Pink Lady<br>
**Price**: $ 1.5 / lb<br>
**Freshness**: Excellent
"
names(apple_buttons_option)[3] <- "
**Option 3**<br>
<img src='images/honeycrisp.jpg' width=100><br>
**Type**: Honeycrisp<br>
**Price**: $ 2 / lb<br>
**Freshness**: Poor
"
sd_question(
type = 'mc_buttons',
id = 'cbc_practice',
label = "For example, if these were the only apples available, which would you choose?",
option = apple_buttons_option
)
sd_next()
```
:::
::: {#cbc_intro .sd-page}
# Conjoint Question Intro
Great work!
We will now show you 6 sets of choice questions starting on the next page.
```{r}
sd_next()
```
:::
::: {#cbc_q1 .sd-page}
# Conjoint Question 1
```{r}
sd_output("cbc_q1", type = "question")
sd_next()
```
:::
::: {#cbc_q2 .sd-page}
# Conjoint Question 2
```{r}
sd_output("cbc_q2", type = "question")
sd_next()
```
:::
::: {#cbc_q3 .sd-page}
# Conjoint Question 3
```{r}
sd_output("cbc_q3", type = "question")
sd_next()
```
:::
::: {#cbc_q4 .sd-page}
# Conjoint Question 4
```{r}
sd_output("cbc_q4", type = "question")
sd_next()
```
:::
::: {#cbc_q5 .sd-page}
# Conjoint Question 5
```{r}
sd_output("cbc_q5", type = "question")
sd_next()
```
:::
::: {#cbc_q6 .sd-page}
# Conjoint Question 6
```{r}
sd_output("cbc_q6", type = "question")
sd_next()
```
:::
::: {#apple_knowledge .sd-page}
# Apple Knowledge
Thank you for your feedback! The next section will ask some basic questions about apples.
Please answer to the best of your knowledge.
```{r}
label <- 'Please select the type of this apple:
<img src="images/fuji.jpg" width=100>'
sd_question(
type = 'select',
id = 'apple_knowledge_1',
label = label,
option = c(
'Fuji' = 'fuji',
'Gala' = 'gala',
'Honeycrisp' = 'honeycrisp',
'Pink Lady' = 'pink_lady',
'Red Delicious' = 'red_delicious'
),
width = "500px"
)
label <- 'Please select the type of this apple:
<img src="images/gala.jpg" width=100>'
sd_question(
type = 'select',
id = 'apple_knowledge_2',
label = label,
option = c(
'Fuji' = 'fuji',
'Gala' = 'gala',
'Honeycrisp' = 'honeycrisp',
'Pink Lady' = 'pink_lady',
'Red Delicious' = 'red_delicious'
),
width = "500px"
)
sd_next()
```
:::
::: {#demographics .sd-page}
# Demographics Page
## Nice job!
We're almost done! We'd just like to ask just a few more questions about you which we will only use for analyzing our survey data.
::: {style="width:500px; margin: 0 auto;"}
```{r}
# Construct the list of years
years <- as.character(2003:1920)
names(years) <- years
years <- c("Prefer not to say" = "prefer_not_say", years)
sd_question(
type = 'select',
id = 'year_of_birth',
label = "(1) In what year were you born?",
option = years
)
genders <- c(
"Male" = "male",
"Female" = "female",
"Non-binary" = "non_binary",
"Trans male/trans man" = "trans_male",
"Trans female/trans woman" = "trans_female",
"Prefer not to say" = "prefer_not_to_say"
)
sd_question(
type = 'select',
id = 'gender',
label = "(2) What is your current gender identity?",
option = genders
)
races <- c(
"White (Not of Hispanic or Latino origin)" = "white",
"African American or Black" = "black",
"Asian" = "asian",
"Hispanic or Latino" = "hispanic",
"American Indian or Alaska Native" = "native_american",
"Native Hawaiian or Other Pacific Islander" = "pacific_islander",
"Prefer not to say" = "prefer_not_to_say"
)
sd_question(
type = 'select',
id = 'race',
label = "(3) I identify my race as (select all that apply):",
option = races
)
educations <- c(
"Less than high school" = "less_than_high_school",
"High school" = "high_school",
"Some college" = "some_college",
"Associate's degree" = "associate_degree",
"Bachelor's degree" = "bachelor_degree",
"Master's degree" = "master_degree",
"Doctoral degree" = "doctoral_degree",
"Prefer not to say" = "prefer_not_to_say"
)
sd_question(
type = 'select',
id = 'education',
label = "(4) What is the highest degree or level of school you have completed? If currently enrolled, please use the highest degree received.",
option = educations
)
incomes <- c(
"Less than $10,000" = "less_than_10k",
"$10,000 to $14,999" = "10k_to_14k",
"$15,000 to $19,999" = "15k_to_19k",
"$20,000 to $24,999" = "20k_to_24k",
"$25,000 to $29,999" = "25k_to_29k",
"$30,000 to $34,999" = "30k_to_34k",
"$35,000 to $39,999" = "35k_to_39k",
"$40,000 to $49,999" = "40k_to_49k",
"$50,000 to $74,999" = "50k_to_74k",
"$75,000 to $99,999" = "75k_to_99k",
"$100,000 to $149,999" = "100k_to_149k",
"$150,000 to $199,999" = "150k_to_199k",
"$200,000 or more" = "200k_or_more",
"Prefer not to say" = "prefer_not_to_say"
)
sd_question(
type = 'select',
id = 'income',
label = "(5) What is your annual household income (from all sources) before taxes and other deductions from pay?",
option = incomes
)
sd_question(
type = "textarea",
id = "feedback",
label =
"Please let us know if you have any other thoughts or feedback on this survey.
Your feedback will help us make future improvements :)"
)
sd_next()
```
:::
:::
::: {#end_normal .sd-page}
# End Page
The survey is finished. Thank you for your feedback!
Your completion code is: **`r sd_output('completion_code', type = 'value')`**
You may close the window now.
```{r}
sd_close()
```
:::
::: {#end_consent .sd-page}
# End Page
The survey is now finished. You may close the window.
```{r}
sd_close()
```
:::
::: {#end_screenout .sd-page}
# End Page
Sorry, we wanted you to select the **red** button.
The survey is now finished. You may close the window.
```{r}
sd_close()
```
:::