I have a combined issue, and while I can find the solutions to each one individually, they do not work with the combination of my two problems together.
I have panel data shown at the bottom. I'm looking for the observations to be the time spanned by the data set, daily. I'm also looking for the variables of the data set to be all the classrooms (one variable for each classroom) rather than the single categorical variable we have now. The dates that are missing are days where there were zero incidents. I would like to move my date variable to an index where every day is present, then fill all the values with zeroes for the respective missing data
Here is a sample of my data. FYI, the index is jumbled up right now because I sorted it all by date.
Can anyone help me tackle this?
What I have:
class incidents date
194 Classroom A 1 2016-01-05
273 Classroom C 1 2016-01-05
0 Classroom B 1 2016-01-07
281 Classroom C 2 2016-01-08