I'm analyzing some data I collected for 3 weeks, in particular I would like to correlate a dependent variable (y) to other 10 indipendent metereological variables (x1 - x10); I was thinking on multivariate regression but I would like also to consider the stationary data as time series, as all the data were collected every 5 minutes for the entire time range. Something like this: y(t) ~ a1 * x1 (t) + ... + a10 * x10 (t) + q (t) What kind of models could you kindly suggest, to run in R cran? Alternatively, I would like also to approach to a sort of cluster analysis that considers also time as covariate but a didn't find the right package for R cran. Thank you in advance, Elisa
1
votes
1 Answers
1
votes
However, your equation y(t) ~ a1 * x1 (t) + ... + a10 * x10 (t) + q (t) isn't really a time series model as all the inputs are at time t. Did you mean something like y(t) ~ a1 * x1 (t) + ... + a10 * x10 (t) + y(t - 1) instead?
The function stats::arima
can fit multivariate time series models using the argument xreg
to include the covariates.
To do clustering with time as a covariate, simply convert your time column to a numeric column. Then there are a large number of methods for clustering including kmeans
and hclust(dist(myData))
. See here for more details.