Hi,

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)
As the category doesn't actually exist, I am unsure as to whether there is a way to make Stata think it does.

Thank you!