Data and description of variables
Image 1: Picture 1 and Sample unbalanced paneldata
Issue
Image 2: Picture 2
What I have tried
End remark
The problem I think, might be that I have to use the unbalanced set in order to create this independent variable, i.e. that I am attempting to use a balanced set instead of the unbalanced one. I also posted the question, in a MUCH more unclear format on stack exchange earlier, and I received therefore an answer there accordingly. But now, I have corrected the question to the best of my ability, and posted it here as well, as it is perhaps more relevant with regards to the software used. The link to the question on stack exchange that is added under:
http://stackoverflow.com/questions/4...75393#42375393
Image 1: Picture 1 and Sample unbalanced paneldata
- Picture 1 shows a balanced panel data that I have created using an unbalanced one provided as a sample in the same image, where I had multiple products (ID) for different amount of years (YEAR). For each product, there were a different number of Shops offering the given product (ID). So as stated, this is a balanced set created by sorting out for the same years, same products (ID), and same shops (marked by the orange area in the sample unbalanced paneldata). This is an important assumption that might affect the perception of the issue stated below. The following is therefore a description of the table shown in Picture 1:
- Years indicates the amount of period a product lasts for a given product (ID)
- Shop 1, Shop 2, Shop 3 indicate different prices for a given product (ID) by different firms
- The minimum and second minimum value depict what shops for a given year and product (ID), have the lowest and second lowest price for that given year. This is needed to calculate the Price difference, which is **(Second minimum value - Minimum Value) / (Minimum Value)
- An example of this, is given for row 5 (Year 01.01.1995 - ID 101) where Price difference would be (3999-3790)/3790 = 5,51% (In Picture 1)
Issue
- In my balanced panel data, (Picture 1), I want to run a fixed effect regression in STATA using xtreg function, where the dependent variable is the Price difference, and number of shops selling a product are the independent variables. This is, so I can say how Price difference as a dependent variable is affected when there is 1 shop selling, when there are two shops selling, and when there are three shops selling.
- Another problem is, is my assumption valid at all of creating a balanced panel? Is it correct to create a balanced from the unbalanced paneldata, or must I use the unbalanced panel to create such a variable?
- So my main issue is how to create such independent variables, that measure the dimension of number of shops offering products. To clarify what I mean, I have included an example of a sample fixed effect regression that may explain the structure that I attempt to seek, in Picture 2 below:
Image 2: Picture 2
What I have tried
- I have tried, using dummy variables, on shops, but they ended up getting dropped. The dataset provided in picture 1 is a balanced data set as mentioned, which is needed to run (I assume) a fixed effect regression on a paneldata.
End remark
The problem I think, might be that I have to use the unbalanced set in order to create this independent variable, i.e. that I am attempting to use a balanced set instead of the unbalanced one. I also posted the question, in a MUCH more unclear format on stack exchange earlier, and I received therefore an answer there accordingly. But now, I have corrected the question to the best of my ability, and posted it here as well, as it is perhaps more relevant with regards to the software used. The link to the question on stack exchange that is added under:
http://stackoverflow.com/questions/4...75393#42375393
Comment