using a time column which is not year #298
-
Hello, the data I am using have a monthly resolution, not yearly. I would like to use the spatiotemporal model. In this case, in which format should my "month+year" time column be ? I tried putting the time column in the format "YYYY-MM" (so as a character). I named this column "year_month", and then used the code: This seemed to run ok, but when using the 'predict' function (in this case I repredicted on the same data), i.e. What format should I use for time when the data is collected more frequently than yearly? Do you have any other advice for the model run in this case? Many thanks, Lily |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi Lily, this may be happening because time is assumed to be something that can be coerced to numeric internally. Could you try creating a new variable
|
Beta Was this translation helpful? Give feedback.
-
For better or worse, the current method for creating the internal time index is with the function make_year_i <- function(x) {
x <- as.integer(as.factor(x))
x - min(x)
} where |
Beta Was this translation helpful? Give feedback.
Hi Lily, this may be happening because time is assumed to be something that can be coerced to numeric internally. Could you try creating a new variable
year_month_n
that represents the months in chronological order, and passing that into thetime
argument?