I am trying to tabulate a variable & then use matcell/matrow to build an output table with putexcel. I am having a problem as the variable I am trying to tabulate could have taken a specific value, but this never appears in the data, however, I want this to value/label to show in the output table (with frequency of 0).
I use "auto.dta" & replace rep78=3 to equal 6 to explain. In this example, say rep78 could have taken any value from 1-6, but only 1-2 and 4-6 appear in the dataset. Is there a way to tabulate this to include the missing category (rep78=3).
Code:
// set data webuse auto replace rep78=6 if rep78==3 // tabulate tabulate rep78, matcell(freq) matrow(names)
Thank you!
0 Response to Tabulate a variable to include a value for which there are no observations
Post a Comment