How to compare 2 groups on a survey outcome
Source:vignettes/articles/guides/compare-2-groups-on-a-survey-outcome.Rmd
compare-2-groups-on-a-survey-outcome.RmdCompare a numeric outcome between 2 independent groups of respondents.
The example in this guide is In person or online? A comparison of engagement between people who attended an event in person and those who attended online, measured by the number of sessions each attended.
In SurveyStudio
- In RStudio, open the Addins menu, choose
surveyframe: Try a demo and pick
two_group. - On Design, choose Plan and open RQ1. The outcome is the number of sessions and the group is the attendance format.
- Compare RQ1 with RQ2: the t-test compares means, and the Mann-Whitney test compares ranks for an outcome far from normal.
- On Analyse, run both and check the assumption notes before choosing which to report.
In R
d <- sframe_demo("two_group")
results <- run_analysis_plan(d$responses, d$instrument)The research questions and what the report gives
| Research question | Method | What the report gives |
|---|---|---|
| Do in-person and online attendees reach a different number of sessions? | Independent samples t-test | The APA 7 sentence and a table, with a chart where the method has one |
| Do in-person and online attendees differ in sessions attended, without assuming normality? | Mann-Whitney U test | The APA 7 sentence and a table, with a chart where the method has one |
Run the example in SurveyStudio or R to see the results, each marked as demonstration data.