Hi all,
I have the following issue, I want to create a panel out of data that contains a code (the product), a date and a price. The problem is, the way data was collected, instead of referring to a month (is supposed to be monthly), the dates refer to the actual date prices were input into the dataset. An example:
Code Price Date
77348 0.6439 03/11/2015
77348 0.6588 01/12/2015
77348 0.672 30/12/2015
See, the issue is that, for the same code, I have two entries in the same month, which doesn't allow to create the panel. The dates should instead refer to the end of the month, so that, that date 01/12/2015 should refer to November, 03/11/2015 should refer to October and so forth. That is, dates that are ate at the beginning of the month refer to the last month, dates that are at the end of the month reflect the prices at that same month.
I just don't know a way to correct this and create another time variable in Stata, since the dates are so random.
Any help is appreciated.
Related Posts with Trouble with repeated dates and panel creation
rocreg cut-off at 95% specificity?Hi, I have run an roc regression with a binary outcome binvar1 and continuous predictor contvar2, se…
baseline adjustment in multiple time pointHi Statalisters, Code: clear set seed 1234 set obs 200 gen id = _n expand 3 sort id bysort id: ge…
Matrix colnamesHi all, I want to add an additional row in a matrix, which displays the names of grouped columns. T…
replacing all values in one variable[CODE ]NEWID plot Q1 Q2 1 _01 12 100 1 _02 21 100 1 _03 32 100 1 _04 35 100 1 _05 38 100 1 _06 44 10…
Tests of robustness?Hey all, I am new in Statalist and I am looking for help concerning tests of robustness. I shall do…
Subscribe to:
Post Comments (Atom)
0 Response to Trouble with repeated dates and panel creation
Post a Comment