Hi!
I am working on a project to estimate price elasticity. My data set is aggregated on product - store - week. We also have a dummy (Online) for whether the product were bought online or in-store. If Online = 1, product was bought Online.
Data example:
Product | Store | Week | Online
001 | A | 1 | 0
001 | A | 1 | 1
001 | B | 1 | 0
001 | B | 1 | 1
001 | C | 1 | 0
001 | C | 1 | 1
002 | A | 2 | 0
002 | B | 2 | 0
005 | A | 3 | 1
005 | C | 3 | 1
etc.
The data set consists of over 600 000 observations like the ones above. The data set contains observations for two years. I created a new variable that contains week and year (year_week).
My basic model for estimating price elasicity is: log(q) = a + b*log(p) + ...
I want to use fixed effect on product level.
The problem: Since I have several dimensions in my data set, I get some trouble when I try to define our panel data. I first ran the following code:
xtset product year_week
But I got the error message "repeated time values within panel (r451)". I realize that this is because we are observing many stores, both online and offline.
To overcome the problem, I created a new variable where I combined store, product and dummy Online so that I had an unique ID. Still I receive the error message: repeated time values within panel (r451) when I run the following code:
xtset uniqueID year_week
My uniqueID is a numberic value, that from our example data row 1 would look like this: 001A0 (product-store-Online).
I believe that there are some product spesific effects, as well as some store effects and also a combination of product-store effects.
Do anyone have any suggestions for how to overcome my problem?
Thanks!
Related Posts with Panel data with three dimensions
Stata- margins and rifreg commandHi, We have a problem with margins after rifreg command: it works without writting xi in front of ri…
Rosenbaum BoundsHi, I have conducted propensity score matching using the WHO-5 Mental Health Index as my outcome va…
Does data on a time series need to be balanced like panel data?Does data on a time series need to be balanced like panel data? …
P trend valueHello, I'm trying to calculate the P trend value for an event risk according to the different disea…
Generating a New Variable based on Conditional IF StatementsHello STATA Experts: I am trying to create a new variable based on the existence of certain conditio…
Subscribe to:
Post Comments (Atom)
0 Response to Panel data with three dimensions
Post a Comment