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
Command for stratifying categorical variableDear, I want stratify my predictors (marital status, religion, education level, employment status fo…
suest - variance matrix is nonsymmetric or highly singularI fit the full multinomial logit model for all four alternatives of my response variable and four re…
Number of different values of a given variable for every combination of other two variablesI have a hospital record dataset with variables such as hospitalisation id (n_aih), year of hospital…
Double sorted portfolio - Error EstimationI have to make a double sorted portfolio analysis. First I need to regress a simple linear model wit…
c.ingroup##c.inyear vs i.ingroup##i.inyearDear All, I run a DID regression with the following command (the first one is working, but the secon…
Subscribe to:
Post Comments (Atom)
0 Response to Panel data with three dimensions
Post a Comment