Suppose you want to calculate some simple averages across time, with survey weights, and plot them as a line plot with confidence intervals. Suppose you have really good reasons why you absolutely must use the command mean.
A quick equivalent example with made-up survey weights (and apologies if there is a better dataset I could have used) would be:
It is puzzling to me that StataCorp did not see fit to add the simple rownames(newvar) option to svmat. Instead, users need to rely on a different package (svmat2) or leap all the way into Mata. Why? Is there some serious technical hurdle that needs to be worked around with great effort to obtain this simple added functionality from svmat? Or does StataCorp simply not think that it is of any use at all to copy matrix row names into the data table, while the column names are a must-have? Is it simply to force users to switch to Mata altogether?
A quick equivalent example with made-up survey weights (and apologies if there is a better dataset I could have used) would be:
Code:
sysuse bplong, clear gen fakepweights=1/runiform() mean bp [pweight=fakepweights], over(agegrp) matrix result=r(table) clear svmat result, rownames(agegroup) graph twoway (line b agegroup) (rcap ul ll agegroup), legend(off)

Comment