This article describes how to go from a standard table...
...to a table that shows the average across the rows and the average across the columns:
Requirements
A table with more than one row and more than one column.
Method
1. In the toolbar, go to Calculation > Custom Code. Click on the page to place the output.
2. In the code editor, type in tab = and position the cursor after the = sign.
3. On the Page, hover over the original table, and click the table's reference name in the top left. It'll look something like this before you click (where in this example, the table reference name is table.q5
4. Now paste in the below that first line to calculate the averages:
attr.avg = colMeans(tab)
tab2 = rbind(tab,"Average" = attr.avg)
brand.avg = rowMeans(tab2)
new.tab = cbind(tab2,"Average" = brand.avg)This code calculates the average for the columns via colMeans and then adds this as a table row using rbind. Next, it calculates the average of the rows via rowMeans and then adds this as a table column using cbind.
5. Select this output and in the object inspector , go to Appearance > Appearance > Decimals to adjust decimal places and Number format to add a percentage sign.
UPCOMING WEBINAR: The Roadmap for Market Researchers in the Age of AI