[R] which data structure for a set of time series ?

Spencer Graves spencer.graves at pdf.com
Thu Jul 13 17:46:39 CEST 2006


	  A data.frame is perfect for storing both qualitative and quantitative 
variables together when they all have more or less the same length and 
where the observations are connected by something like time.  Without 
substantive common connection, people usually put variables in different 
data.frames.

	  Have you reviewed the information on data.frames in "An Introduction 
to R", available via 'help.start()'?  Also regarding coding time, have 
you reviewed the "zoo" vignette?  (See, e.g., 
"http://finzi.psych.upenn.edu/R/Rhelp02a/archive/67006.html".)

	  Hope this helps.
	  Spencer Graves

Roolio wrote:
> Hello,
> I'm a R newcomer and I'm wondering the kind of data structure that would
> best fit to my problem:
> my data are equities (stocks) : so I have a time serie (say 1 year of weekly
> data), and a bunch of qualitative + quantitative variables :
> the sector of the stock (biotech/finance...), the geographical region, the
> name, ISIN code, P/E ratios, whatever...
> 
> The data.frame is perfect for the qualitative variables : a row is a stock,
> a column is a variable .
> But where can I store the time serie? If I put each weekly data in a column
> of the data frame
> , I'm not sure that it's the best structure when I will want to test
> some models on these
> (regressions/arma/whatever).
> I would prefer to have a new data frame, where each column is a stock, each
> row a date, to do the regressions (across time more easily)
> 
> So I would end up with 2 data frames, one of each transposed... No good,
> probably.
> 
> I thought of a set of 2 objects : 1 data frame (for the qualitative
> variables), and one list of time series, in the same order, with the risk of
> 
> forgetting to subset one objet and not the other, etc...
> 
> Do you happen to have the same kind of problem?
> Is there something equivalent in R as the matlab 'structures' ? (kinda R
> data frame, where you can store multi-dimensional objects in a column)
> 
> Many thanks in advance.
> 
> Regards
> 
> Roolio
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list