Toggle navigation
Home
▼ Details
Products and pricing
Chart gallery
User stories
Text analytics
CDC NAMCS Library
Blog
Tutorials
Contact
Sign in
Post Editor
← All help posts
View post
Save
<img src="/uploads/upload/image/5200/direct/1595435199871-1595435199871.png" alt="Conceptual illustration showing a paired data table with rows and columns represented by gray bars and colored cells in blue and green." style="width: 388px;" class="fr-fic fr-dib"> Protobi's primary bar chart is designed to compare subsets of respondents, but sometimes you need to compare respondents to themselves. Consider the following: - are they more likely to choose *this* answer than *other* answers - are they more likely to answer yes to *this* answer than *other* questions Then again, maybe you just want to align a grid of questions neatly in a table. ## Using a PairedTable A PairedTable allows you to neatly display collections of questions together, and run pairwise comparisons for stronger statistical tests. Below is an example from [Pew Research's Gender and Generations survey](https://www.pewsocialtrends.org/2014/01/07/gender-and-generations/). Each respondent rated how similar they perceive different groups: <img src="/uploads/upload/image/5200/direct/1571196907137-1571196907137.png" alt="Four-panel survey visualization showing perceived conflicts in America between different groups, with horizontal bar charts displaying response percentages for each question." style="width: 800px;" class="fr-fic fr-dib"> In the example above, 28% of respondents report strong conflicts between "Young people and older people." 57% of respondents report strong conflicts between "Poor people and rich people." The difference in responses seems sizable, but is it statistically significant? That's where PairedTables can be useful. ## Paired table Below is the same data organized as a paired table. The data organized with each child as a column and each value as a row. <img src="/uploads/upload/image/5200/direct/1571197222365-1571197222365.png" alt="Paired table showing the same conflict survey data reorganized with each question as a column and response values as rows, displaying percentages and statistical significance markers across columns." class="fr-fic fr-dib"> ## PairedTables: statistics PairedTable uses a [paired difference t-test](https://en.wikipedia.org/wiki/Paired_difference_test) to compare means, and [McNemar's test](https://en.wikipedia.org/wiki/McNemar%27s_test) (with small sample corrections) to compare percentages. In a PairedTable, each column is compared with each other individual column. Blue column labels highlight statistically significant difference between questions. Cells show counts/frequencies for all respondents, but each statistical test to compare whether differences between two questions are significant considers only respondents who answered both questions. <img src="/uploads/upload/image/5200/direct/1591293130439-1591293130439.png" alt="Paired table with five columns showing conflict perception data with blue statistical significance markers highlighting significant differences between questions." class="fr-fic fr-dib"> ### Turn statistics on/off You can turn pairwise testing off in "[Additional options](http://help.protobi.com/editaccess/charttypes#Additional%20options-17)", press the green checkmark to deselect "testPairwiseSignificance". A blue x indicates an option has been deselected. <img src="/uploads/upload/image/5200/direct/1591293997671-1591293997671.png" alt="Chart options dialog showing the testPairwiseSignificance setting highlighted with a green checkmark, indicating it is enabled." style="width: 360px;" class="fr-fic fr-dib"> ## Create a paired table To create a paired table, press the blue square edit icon and select "Chart type," select "paired": <img src="/uploads/upload/image/5200/direct/1559794160481-1559794160481.jpeg" alt="image.png" style="width: 480px;" class="fr-fic fr-dib"> Alternatively, press the blue square edit icon and select "Edit JSON..." and in the JSON, specify a `chartType` attribute: ```json { "chartType": "PairedTable" } ``` ## Transpose a PairedTable The default is to show each variable as a column and each response value as a row. This makes the view look more like a traditional crosstab. However, if you have many variables and fewer response options you can transpose the table by choosing swap under "Chart options" in the chart dialogue. This will yield a transposed table with one row per question and one column per response option. Here, the statistical comparisons are between rows rather than columns: <img src="/uploads/upload/image/5200/direct/1560262125548-1560262125548.jpeg" alt="Transposed paired table showing conflict survey questions as rows and response categories as columns, with blue statistical significance markers on row labels." style="width: 1000px; text-align: center;" class="fr-fic fr-dib"> ## Stats testing Protobi can optionally compare columns for significantly significant differences. To enable stats tests, open the [Properties Dialog](/edit-access/element-properties) and select “showSignificance”. ## Independent vs Paired samples Protobi can compare columns as either “Independent samples” or “Paired samples”. Paired sample testing is more sensitive (i.e. it is more likely to show a small difference as “significant”). But it only applies when both columns have the same “base”, in other words, when every respondent who answers one column also answers the other. Independent sample testing is more conservative but it applies when two questions are answered by different respondents. To enable paired testing, open the [Properties Dialog](/edit-access/element-properties) and select “testPairwise”. In the example below we see two questions where the result is 50% green in one and 60% green in the other. But in the first case, we don't know who is who, all we know is that it question says 50% is green, and in the other says 60% is green. In the second case, we can “pair” the samples, and can see if someone switched values or stayed the same. <img src="/uploads/upload/image/5200/direct/1656986434042-1656986434042.png" alt="Comparison diagram showing independent versus paired samples using stacked bar charts in blue and green, illustrating the difference in what can be inferred from each approach." style="width: 631px;" class="fr-fic fr-dib"> ## Stats tests for independent samples The Z tests is the most common test for proportions between independent samples: <img src="/uploads/upload/image/5200/direct/1656986708217-1656986708217.png" alt="Mathematical formula for the Z-test statistic used for comparing proportions between independent samples." class="fr-fic fr-dib"> This statistic theoretically has a standard normal distribution for large samples. There are many variations of this test, particularly if either the sample size or the population size is small. Protobi uses the standard Z test, when both n1 and n2 exceed a minimum sample size, which defaults to 20 for most projects. ## Stats tests for paired samples McNemar’s test is designed to test differences in sample proportions in paired samples. This statistic theoretically has a Chi-Square distribution for large samples. This test also has variations for sample and population sizes. Protobi uses McNemar’s test with Edward’s Correction for Continuity, which is the variant most commonly today, including the language [R](https://cran.r-project.org/web/packages/exact2x2/vignettes/exactMcNemar.pdf) : <img src="/uploads/upload/image/5200/direct/1656986789827-1656986789827.png" alt="Mathematical formula for McNemar's chi-square test with Edwards' Correction for Continuity used for paired sample testing." style="width: 256px;" class="fr-fic fr-dib"> ## Examples The following example shows three variations of two questions, which we might call “before” and “after” . ### Ex#1: Independent samples In the first example, the samples are independent. We can't say who's who or who switched. All we can say is that out of 150 respondents in each sample, in the first one 50% were green, and in the second 60% were green: <img src="/uploads/upload/image/5200/direct/1656989939532-1656989939532.png" alt="Two side-by-side stacked bar charts showing independent samples with 50% green and 50% blue in the first, and 60% green and 40% blue in the second, both with N=150." style="width: 317px;" class="fr-fic fr-dib"> In this example - z = 1.74 - p = 0.081 so “**not significant**” since p > 0.05 ### Ex #2: Paired samples This example shows the same 10% point increase from 50% to 60% but here all of that difference is due to 15 blues switching to green: <img src="/uploads/upload/image/5200/direct/1656990840467-1656990840467.png" alt="Paired sample visualization showing one stacked bar chart transforming into another via arrows, with all change from blue to green shown by a single directional arrow." style="width: 313px;" class="fr-fic fr-dib"> - b =15 (discordant pairs in one direction, e.g. green to blue) - c = 0 (discordant pairs the other direction, e.g. blue to green - X^2 = ( |15 – 0 | – 1)^2 / (15 + 0) = 13.1 - p = 0.0003 so “**significant**”, p < 0.05 ### Ex #3: Paired samples This example shows the same 10% point increase from 50% to 60% but here all of that difference is due to 15 blues switching to green <img src="/uploads/upload/image/5200/direct/1656990950232-1656990950232.png" alt="Paired sample visualization showing bidirectional changes with arrows indicating both blue-to-green and green-to-blue switches between the two time points." style="width: 310px;" class="fr-fic fr-dib"> Image Caption - b = 40 (discordant pairs in one direction) - c = 25 (discordant pairs the other direction) - X^2 = ( |40 – 25 | – 1)^2 / (40 + 25) = 3.01 - p = 0.082 so “**not significant**”, p > 0.05 This tutorial describes paired tables and the optional stats tests that can be applied. For your project, we'll be happy to help you set up the appropriate settings for your project at [support@protobi.com](mailto:support@protobi.com)
Publishing
Date
Status
Published
Draft
Slug
edit
Content
Thumbnail
Categories
Manage
New to Protobi?
Charts
Making Changes
Intermediate topics for editors
Frequently Asked Questions
SERMO Topics
Tutorial Pages
Internal Docs
Data Processing
Videos
Obsolete
GSG Admin
SERMO Admin
GSG Topics
How to...
Basics for viewers
Basics for editors
For project admins
Advanced topics
Assessments
Articles (in-progress)
New and updated articles
Process data in Protobi
superseded
Text open-end questions
Troubleshooting
Tracking studies
Organizing the view
API References
Tools
AI Database
Checking AI...
Convert to MD
Danger zone
Delete