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: shifting data inside panel data


From   Tomáš Houška <[email protected]>
To   [email protected]
Subject   st: shifting data inside panel data
Date   Fri, 4 May 2012 09:37:55 +0200

Dear Statalist,

I have panel data of the following structure: "Store - Week -
Product_ID - Price - Quantity". Where there are multiple week data for
each store and multiple products being sold in each store every week.
Overall I have 36 stores, 28 products and 220 weeks, the data are in a
long format. The dataset is symmetric - all products were sold in
every store and in every week.

I am trying to create a new variable (lets call it "price_iv"), which
will be an instrumental variable for my demand analysis. I would like
the variable to contain for each product in each week prices from a
different store - i.e. I would like to shift the price data in the
"price" variable in such a way, that price of a product 1 in week one
and store 1 will correspond to the prices of product 1 in week in and
store 2 (or any other). Optimally each store will be used only once -
so at the end the data from all stores would be assigned to a
different store.
I havent been able to come up with a way, how to shift the data in an
appropriate way - Can you please help me solve this problem?

Thank you !
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