Re: Time Series Data in Quarters [correction]
- To: mathgroup at smc.vnet.net
- Subject: [mg112191] Re: Time Series Data in Quarters [correction]
- From: Michael Stern <nycstern at gmail.com>
- Date: Sat, 4 Sep 2010 04:00:02 -0400 (EDT)
[fixing the number of days in the month. "30 days hath september," etc.] It should be easy to replace the quarterly date stamp with something Mathematica will recognize, but I can't provide sample code without knowing precisely what you are starting with. For example, startingData=={{"2009q1",1},{"2009q2",2},{"2009q3",2.2}}; datifier[malformedThing_] :== \ {{ToExpression[StringJoin[Take[Characters[malformedThing[[ 1]]], 4]]], Switch[Cchaharacters[malformedThing[[1]]][[6]], "1", 3, "2", \ 6, "3", 9, "4", 12], Switch[Characters[ malformedThing[[ 1]]][[6]], "1", 31, "2", 30, "3", 30, "4", 31]}, malformedThing[[2]]} cleanedUpData==Map[datifier[#] &, startingData]; DateListPlot[cleanedUpData] Michael On Sep 3, 2010, at 6:08 AM, jroge wrote: > I just received some financial data that I would like to analyze, > however the data is by fiscal quarter. DateListPlot seems to require > specific dates for plotting, rather than an option that is more > abstract such as Q1, 2007. Any suggestions? >