Hello,
I am using proc report to create a table showing the relative frequencies of likert variables (scored from 0 to 10) in a sample, where the variables are listed in rows and the categories in columns. So, the table ends up looking something like this:
0 1 2 3 4 5 8 9 10
Var 1 .3 .2 .02 .02 .01 .2 .1 .05 .1
Var 2 .02 .2 .3 .02 .01 .2 .1 .05 .1
.
.
.
I can do this by creating a data set structured as follows:
PersonID VarLabel Score
1 Var1 2
1 Var2 10
2 Var1 4
2 Var2 8
.
.
.
and then use Proc Report, treat "Score" as an ACROSS variable, and VarLabel as a Group Variable.
However, I am running into problems whenever a category variable is missing from the above data set (such as, for example, "5"). In this case the proc report code omits "5" from the column, and since I am using COMPUTE statements to get the relative frequencies , the references to the columns will also have to adjusted depending on the missing categories.
Is there a way to include the missing categories into the table (showing the frequency of zero) when using an ACROSS variable?
Thank you,
FC
I am using proc report to create a table showing the relative frequencies of likert variables (scored from 0 to 10) in a sample, where the variables are listed in rows and the categories in columns. So, the table ends up looking something like this:
0 1 2 3 4 5 8 9 10
Var 1 .3 .2 .02 .02 .01 .2 .1 .05 .1
Var 2 .02 .2 .3 .02 .01 .2 .1 .05 .1
.
.
.
I can do this by creating a data set structured as follows:
PersonID VarLabel Score
1 Var1 2
1 Var2 10
2 Var1 4
2 Var2 8
.
.
.
and then use Proc Report, treat "Score" as an ACROSS variable, and VarLabel as a Group Variable.
However, I am running into problems whenever a category variable is missing from the above data set (such as, for example, "5"). In this case the proc report code omits "5" from the column, and since I am using COMPUTE statements to get the relative frequencies , the references to the columns will also have to adjusted depending on the missing categories.
Is there a way to include the missing categories into the table (showing the frequency of zero) when using an ACROSS variable?
Thank you,
FC