# Dear List, # I want to characterize a time series according to its Quarter components.
# My data ("a.ts": http://docs.google.com/View?id=dfvvwzr2_478cr9k4cdb) look like: # Qtr1 Qtr2 Qtr3 Qtr4 # 1948 -0.0714961837 0.0101747827 0.0654816569 -0.0227830729 # 1949 -0.1175517556 0.1151378692 0.1015777858 -0.1971535900 # 1950 0.0716002123 0.2551020416 0.0977574743 -0.0739337411 # ... # The time series is 216 long # The easiest way I could figure out, is to create # Quarter dummies: Q1 <- rep(c(1,0,0,0),54) Q2 <- rep(c(0,1,0,0),54) Q3 <- rep(c(0,0,1,0),54) Q4 <- rep(c(0,0,0,1),54) qtr <- cbind(Q1,Q2,Q3,Q4) # and then regress my data on the dummies. summary(lm(a.ts ~ qtr - 1)) # The regression on 'Quarters' works fine. # It does exactly what I want it to do. # But! Surely there must be a more elegant way # to accomplish the same thing ?! # I have looked at the following packages (amongst others): # tseries, timeSeries, TSA, AER, fSeries, vars, FinTS, xts, fArma, # fRegression, tsfa, uroot, urca, ... # without finding anything more convenient (simpler, nicer!). # Any suggestion? # Thank you. # Len Vir ______________________________________________ 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.