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
Margins "variable not found in list of covariates" logistic regressionHi there, I'm having an issue whereby I am trying to run a margins command following my logit regre…
Help in creating so many dummiesHi I have a data set of 94 countries and number of observations for each country is different. The…
Statistical Non-Significance of results and their interpretion by using confidence intervals and standard errorsDear Stata Members I have done a Difference in Difference model and I got the following output Cod…
Smaller and low quality graphs in Stata 17Dear community, I'm using Stata 17 SE and getting smaller and low-quality graphs than in previous v…
Roc curveHi everyone, I have made a ROC curve to test the predictive power of the credit rating in estimating…
Subscribe to:
Post Comments (Atom)
0 Response to Panel data with three dimensions
Post a Comment