Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: xtreg panel data command


From   Tomáš Houška <[email protected]>
To   [email protected]
Subject   st: xtreg panel data command
Date   Tue, 1 May 2012 13:43:06 +0200

Dear Statalist,

I have a quite complicated dataset structure and I would like to
simplify running -xtreg- command on my dataset. I am currently using
wide data and the -xtreg- command looks like this:

xtreg exp_share1 ln_real_exp_cat ln_price1 ln_price2 ln_price3
ln_beer_sales, i(store) re

which means I am estimating how expenditure share on beer brand 1 is
influenced by overall expenditure on a given category of beer
(premium/light/non-alcoholic...), by prices of other beers within the
same category and by the amount of beer sales withing the given store
each week.

The problem is that I have 5 beer categories and each category
contains approx. 5 beer brands that I would like to do the estimation
for. I am trying to figure out some easy way of writing the -xtreg-
command so that I wouldn't have to write out all the estimation
equations. Any help on this would be very appreciated.

I have trying looping the estimation process, but I cannot figure out
how to adjust the loop so that in the second process, the command
looks like this:

xtreg exp_share2 ln_real_exp_cat ln_price1 ln_price3 ln_price1
ln_beer_sales, i(store) re

I always want to include all brands within the category as indep.
variables but the one that is a dependent variable.

Thank you for you help
Tomas
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index