It's widespread to have a survey where we want to ask similar questions about various topics. We might be asking about different TV shows, product features, or political candidates, but the pattern is generally the same:
Cycle over a set of topics that we want to ask questions about
Ask the same questions about each topic
For example, we could ask about attitudes toward various social media platforms. In this case, our topics could include Facebook, Instagram, Twitter, and TikTok. The survey questions might be something like:
1. How often do you use {platform}?
2. How satisfied are you with your experience on {platform}?
3. How likely will you recommend {platform} to a friend?
4. What do you like most about {platform}?
5. What do you dislike about {platform}?
The same questions are repeated for each platform. This approach allows us to gather consistent data across different topics, making it easier to compare and analyze results.
With MX8, we make this process more efficient in both survey programming and reporting by passing each topic separately to the question, as shown below:
from survey import Survey
s = Survey(**globals())
platforms = ["Facebook", "Instagram", "Twitter", "TikTok"]
for platform in platforms:
s.multi_choice_question(f"How often do you use {platform}?",
options=["Never", "Rarely", "Sometimes", "Often", "Always"])
s.rating_question("How satisfied are you with your experience on {platform}?",
platform=platform,
number_of_points=5,
style="slider",
labels={
1: "Very Dissatisfied",
3: "Neutral",
5: "Very Satisfied"
})
s.rating_question("How likely will you recommend {platform} to a friend?",
platform=platform,
number_of_points=5,
style="slider",
labels={
1: "Very Unlikely",
3: "Neutral",
5: "Very Likely"
})
s.text_question("What do you like most about {platform}?",
platform=platform)
s.text_question(f"What do you dislike about {platform}?",
platform=platform)
s.complete()
In the above example, you can see that we're specifying a different platform for each question. We do that by sending the platform parameter to the question call. This topic will then be added to the question and be available for:
a) Reporting - you can inclue the topic as a row or a column on any report including that question.
b) Question text - you can include the topic in the question text by incorporating it in the question text, surrounded by the curly brackets {}.
This approach can be extended by adding conditional logic in more complex surveys. For instance, if a respondent indicates that they never use a particular platform, the survey can skip the remaining questions for that platform, saving the respondent time and keeping the data clean.
This method not only saves time during the survey design process but also helps in the analysis phase, as the responses can be directly compared across topics, revealing trends, preferences, and areas for improvement.
Reporting options
Here you can see an example in report settings, where two topics are included in the questions in the report, and you can configure them as either row, column, or to ignore them:
Special cases
Some keywords are not allowed to be used as topics. These include keywords that are reserved for use as standard parameters and include:
index
is_valid
error_message
recodes
text
get_custom_error
The keyword "ix" is allowed as a parameter but is unavailable for inclusion in reporting.