surveydown::sd_create_survey(
template = "conjoint_buttons",
path = "hw5/conjoint-practice"
)Conjoint Surveys in surveydown
Due: Oct 05 by 11:59pm
Weight: This assignment is worth 2.5% of your final grade.
Purpose: The purpose of this assignment is to get familiar with how to implement a full conjoint survey in surveydown.
Submit: Commit and push your completed assignment to your course GitHub repository (see the “Submit” section at the end of this assignment).
Assessment: This assignment is graded using a check system:
- ✔+ (110%): Responses show phenomenal thought and engagement with the course content. I will not assign these often.
- ✔ (100%): Responses are thoughtful, well-written, and show engagement with the course content. This is the expected level of performance.
- ✔− (50%): Responses are hastily composed, too short, and/or only cursorily engage with the course content. This grade signals that you need to improve next time. I will hopefully not assign these often.
Notice that this is essentially a pass/fail system. I’m not grading your writing ability and I’m not counting the number of words you write - I’m looking for thoughtful engagement. One or two sentences is not enough. Write at least a paragraph and show me that you did the readings assigned.
1. Get Organized
Open your course repo (madd-f26/madd-netID) in Positron using File > Open Folder… - open the folder itself, not a file inside it. If you haven’t cloned your course repo yet, follow the steps in HW1 first.
Everything for this assignment lives in the hw5 folder. Open the hw5.qmd file inside it - that’s the only file you need to edit. Take notes and write example code under the “Begin notes here” heading as you go through the readings and exercises below, then write your reflection under the “Reflection” heading at the end.
2. Readings
Your next team deliverable is your Pilot Survey, which you’ll build in surveydown. The central questions of that survey are your conjoint questions: sets of randomized choice questions where respondents choose from different sets of alternatives. We haven’t yet gotten into all the details of how to generate those randomized questions (that will come soon!). But it helps at this stage to see how a whole conjoint survey fits together in surveydown, since the template you’ll use in this assignment is the one your team will most likely start the pilot survey from.
With that in mind, read through this blog post I wrote on how to implement a choice-based conjoint survey in surveydown. It may not yet be clear what every piece of code is doing, and that’s fine - the questions in part 4 below will point you to the pieces that matter most. You will probably want to come back to this post as a guide when you build your own survey.
3. Run the conjoint template
Now you’re going to make a working copy of the conjoint buttons template described in the blog post.
Make the survey in a new folder inside your hw5 folder. Every surveydown survey should live in its own separate folder.
- With your course repo open in Positron, create the survey from the template by running this in the R console:
- Open the new
conjoint-practicefolder in Positron (File > Open Folder…), then open theapp.Rfile and click the “Run App” arrow button. If R complains that a package is missing (e.g.glue), install it withinstall.packages()and run the app again. - Click through the whole survey. Note that there’s a screening question partway through - if you give the “wrong” answer, you’ll get screened out and sent to the end of the survey. Take the survey a few times so that you see it both ways.
- Take a screenshot of one of the choice questions, save it in your
hw5folder, and insert it into yourhw5.qmdfile (e.g.,). - Because the survey runs in
mode: preview, each time you complete it your responses are saved topreview_data.csvin the survey folder. Open that file and find your most recent response. What was yourrespID? Now opendata/choice_questions.csvand find the rows with that samerespID. In yourhw5.qmdfile, write a few sentences explaining how those rows relate to the choice questions you saw in the survey. Did the alternatives you saw match the rows in the file?
4. Read the code
Open the app.R and survey.qmd files in your conjoint-practice folder, and use the blog post to help you answer the following questions in your hw5.qmd file. A few sentences each is plenty.
- What does the
make_cbc_options()function do? What goes in, and what comes out? - Where in the code does the survey decide which set of choice questions a particular respondent will see? How is that decision made?
- Why does the survey store
respIDwithsd_store_value()? What would you be unable to do later in your analysis if it didn’t? - The choice questions are created in
app.R, but they appear insurvey.qmd. How do they get from one file to the other? - Suppose your team’s survey will show only two alternatives per question instead of three. What would you need to change in
app.R?
5. Make a change
Now make one small modification to the survey to prove to yourself that you can edit it. For example, change how an attribute is displayed in each option (e.g. the price formatting or the text label), change the wording of the choice question labels, or add a sentence of instructions to the page that introduces the choice questions.
Stop the app and run it again to see your change (surveydown doesn’t always update a running survey when you save). Take a screenshot showing your change, save it in your hw5 folder, and insert it into your hw5.qmd file. Below the screenshot, write a sentence or two describing what you changed and which file(s) you had to edit.
6. Reflect
Reflect on what you’ve learned while going through these readings and exercises. Is there anything that jumped out at you? Anything you found particularly interesting or confusing? Write at least a paragraph in your hw5.qmd file, and include at least one question. The teaching team will review the questions we get and will try to answer them either in Slack or in class.
If you’re unsure where to start with a reflection, try filling out this template:
“I used to think ______, now I think ______ 🤔”
7. Submit
To submit your assignment, follow these instructions:
- Render your .qmd file by either clicking the “Preview” button in Positron or running
quarto renderin the terminal. - Open the rendered html file and make sure it looks good! Is all the formatting as you expected?
- Commit and push your work using GitHub Desktop: look at the diff, write a short commit message, click Commit, then Push.
Your work isn’t submitted until you’ve pushed it. Committing only saves the change on your own computer – go look at your repo on GitHub.com and confirm your work is actually there before you call this done.