I am trying to use the Zoo package to read in daily observations, some of which are not consecutive. The first three lines are:
Date Year ID DWT Build CargoSize LoadArea DischargeArea Price Speed
25-May-07 2007 8004351 294739 1982 262000 AG ECI 79 14.5
11-Feb-08 2008 8004363 294739 1983 261000 AG ECI 84 14.5
11-Feb-08 2008 8003459 294739 1984 265000 WAF SPOR 89 14.5
I get the following error:
z <- read.zoo("multiplier_test.csv", sep = ";", header = TRUE, format="%d-%b-%y")
Warning message:
In zoo(rval3, ix) :
some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique
The goal is to regress Price on some of these variables, including Date, in which I would like to fit a polynomial to (using a partially linear model with the bs function). The error occurs I believe because there are multiple dates that are the same. This represents a separate transaction; I want to capture the variance between these observations so don't want to aggregate and lose degrees of freedom.