Ben Jann's super-useful coefplot generates temporary variables in order to make its plots. And it leaves those variables behind if you use the generate option. I've found that in large data sets this causes a severe speed penalty. The temporary variables are filled mostly with missing, because the data set is much taller than coefplot needs for its variables.
I found an elegant fix for Stata versions that support frames:
Example with the generate option:
In older Stata I would sometimes do
But using a frame should be faster.
I found an elegant fix for Stata versions that support frames:
Code:
cap frame create cp // one-time setup sysuse auto reg price mpg frame cp: coefplot
Code:
frame cp: coefplot, gen replace frame cp: `r(graph)' title(Great graph)
Code:
preserve keep in 1 coefplot restore
Comment