I want to examine the relationship between prices and the supply of gasoline. My dataset consists of 1.2 million observations and contains quoted gas prices from all gas Stations in France throughout the year of 2016.
My assumption is that prices are set siginificantly higher if the supply of gasoline is low (close to being sold out). However, I do not have any data on the amount of gasoline that is left. My only indicator is the quoted price of gasoline which is set to -1 when gasoline is sold out completely. Now I would like to focus on the previous observations before the gasoline is sold out.
For every observation where price is equal to -1,
My assumption is that prices are set siginificantly higher if the supply of gasoline is low (close to being sold out). However, I do not have any data on the amount of gasoline that is left. My only indicator is the quoted price of gasoline which is set to -1 when gasoline is sold out completely. Now I would like to focus on the previous observations before the gasoline is sold out.
For every observation where price is equal to -1,
I would like to define a range of 3 previous observations to show that for these observations the supply of gasoline is low already. Perhaps by creating variables indicating the supply/scarcity of gasoline. In turn, I want to regress price
on the new indicator variable.
As I am new to Stata I am not sure how to translate this into code.
As I am new to Stata I am not sure how to translate this into code.
to clarify the meaning of the variables in the example:
id= the price adjustment ID
stid= unique ID of gas Station
price= price of gasoline*1000, or -1 when sold out
modification= time when price was modified/quoted
Thank you very much in advance
Best Regards
Matthias
Code:
* Example generated by -dataex-. To install: ssc install dataexclearinput long(id stid) double(price modification)29772366 27600001 1107 177935430500029772367 27600001 1112 177963872400029772368 27600001 1116 1.7797863e+1229772369 27600001 1140 1.7798727e+1229772663 27600001 -1 1.7800455e+12endformat %tc modification
Comment