Dave, I am not sure what you try to do, but I have a couple of thoughts:
1. Your t.hh is numerically identical to t.h, except the latter one is the time series. 2. I am guessing you want the same thing for t.d and t.m. If this is the case, all you need to do is repeat what you did with t.h: t.dd <- ts(t.d, freq=24) t.mm <- ts(t.m, freq=24) Hope this helps, Andy From: Dave Evens <daveeve...@yahoo.co.uk> To: "\"r-help@r-project.org\"" <r-help@r-project.org> Date: 06/21/2011 04:13 PM Subject: [R] dynlm Sent by: r-help-boun...@r-project.org Dear All, I'm trying to use dynlm to fit a time series. I have 3 seasonal terms. Here is an example of the problem. This is my time variable, hourly data: timeSeries <- seq(as.POSIXct("2011-01-01 00:00:00"), as.POSIXct("2011-12-31 23:00:00"), by="hour") My response is: y <- rnorm(length(t), 1000, 500) There are 3 seasonal factors: t.h <- as.POSIXlt(t)$hour # hours of the day t.d <- as.POSIXlt(t)$wday # days of the week t.m <- as.POSIXlt(t)$mon # months of the year I can create a time series object for the hour, by doing t.hh <- ts(t.h, freq=24) but how to I create time series objects for the day (t.d) and the month (t.m)? I tried t.dd <- ts(t.d, freq=t.d) but this doesn't work. I would appreciate any help. Regards, Dave [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.