The data I have is on the country, sector and time level. Specifically, I am finding the proportion of a sector's manufacturing output to the country's total manufacturing output for each country and year, i.e. group (CTY Time). The format of this data I am constructing is to be a vector. The problem is that mkmat may not be combined with the by command. Would anyone know a way around this? Thank you very much in advance!