Hi, would someone help me with this problem?
I have millions of observations of the form:
company product year sales
100 4 1990 312
100 4 1991 400
100 4 1992 350
100 4 1993 280
100 4 1994 302
...
I'm trying to measure the volatility of sales after taking out a
company-product-specific time trend.
If there was just one company-product, then I could regress sales on time,
then measure the volatility of the residuals. Given that I have tens of
thousands of company-pairs though, what would be the most efficient way of
doing this?
Also, I would like to ultimately generate a table showing for each
company, average sales volatility for all products sold by the company,
weighted by last period's sales volume. This seems like something that
should be easy to do once I've detrended sales for each company-product.
I would appreciate pointers to the appropriate commands.
Thank you very much for your help.
Jason Hwang
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/