Skip to main content

Hi everyone. I'm trying to get my table to show all of the answer choices to the questions, even if the answer choice does not exist in the data. I'm recreating the following table:

How to show categories that do not exist in the data as zero

 

I wrote the following syntax  to create the income range categories from the raw dataset (because these categories are not even, I did not use bins):

pastedImage_2.png

I noticed that the categories that were not reported by any client in the data were not included in the table.

How do I make it so that the categories that are not found in the dataset are still included in the table and labeled as 0?

pastedImage_3.png

I've already tried "Table Layout" "Show empty columns" and "rows." But because this is one dimensional, not sure if that applies.

 

Thanks,

Katie

7 answers
  1. Dec 1, 2016, 2:24 PM

    Hello Nachiket,

     

    I cannot publish the workbook since it's tied to client personal information.

     

    The example I provided is regarding annual household income. The variable "Income" is a continuous variable and "IncomeID" includes the answer choices, "don't know" and "Refused."

     

    Furthermore, some other string variables that I used in a CASE statement to create the answer choice categories have the answer choices that are missing from the output because there are no clients who reported those specific answers. They are not NULL, they just do not exist in the dataset and thus are not showing up in the table.

     

    I'd like for my output to still show in the table or graph when the answer choice was not selected at all in the data. Here is another example showing how I created the educational attainment answer choice categories, and how the answer choice "refused" does not show in the table because there aren't any clients who refused the question:

     

    Hello Nachiket, I cannot publish the workbook since it's tied to client personal information. The example I provided is regarding annual household income.

     

    pastedImage_1.png

     

    My goal is to still have the "Refused" category in the table and show zero percent.

     

    Thanks,

    Katie

0/9000