1
$\begingroup$

When I use the FRED package to retrieve weekly data, all of the data points for a given month have the date as the last day of the month instead of the date for the week of the data.

FRED["ICSA", {2013, 1, 1}, {2013, 12, 31}, "file_type" -> "xls"]

{{{2013, 1, 31, 0, 0, 0.}, 375000.}, {{2013, 1, 31, 0, 0, 0.}, 
  351000.}, {{2013, 1, 31, 0, 0, 0.}, 
  347000.}, {{2013, 1, 31, 0, 0, 0.}, 
  364000.}, {{2013, 2, 28, 0, 0, 0}, 
  357000.}, {{2013, 2, 28, 0, 0, 0}, 
  349000.}, {{2013, 2, 28, 0, 0, 0}, 
  360000.}, {{2013, 2, 28, 0, 0, 0}, 
  348000.}, {{2013, 3, 31, 0, 0, 0.}, 
  342000.}, {{2013, 3, 31, 0, 0, 0.}, 
  338000.}, {{2013, 3, 31, 0, 0, 0.}, 
  343000.}, {{2013, 3, 31, 0, 0, 0.}, 
  354000.}, {{2013, 3, 31, 0, 0, 0.}, 
  375000.}, {{2013, 4, 30, 0, 0, 0.}, 
  348000.}, {{2013, 4, 30, 0, 0, 0.}, 
  353000.}, {{2013, 4, 30, 0, 0, 0.}, 
  343000.}, {{2013, 4, 30, 0, 0, 0.}, 
  332000.}, {{2013, 5, 31, 0, 0, 0.}, 
  332000.}, {{2013, 5, 31, 0, 0, 0.}, 
  355000.}, {{2013, 5, 31, 0, 0, 0.}, 
  344000.}, {{2013, 5, 31, 0, 0, 0.}, 
  350000.}, {{2013, 6, 30, 0, 0, 0.}, 
  347000.}, {{2013, 6, 30, 0, 0, 0.}, 
  337000.}, {{2013, 6, 30, 0, 0, 0.}, 
  352000.}, {{2013, 6, 30, 0, 0, 0.}, 
  345000.}, {{2013, 6, 30, 0, 0, 0.}, 
  344000.}, {{2013, 7, 31, 0, 0, 0.}, 
  353000.}, {{2013, 7, 31, 0, 0, 0.}, 
  339000.}, {{2013, 7, 31, 0, 0, 0.}, 
  343000.}, {{2013, 7, 31, 0, 0, 0.}, 
  333000.}, {{2013, 8, 31, 0, 0, 0.}, 
  335000.}, {{2013, 8, 31, 0, 0, 0.}, 
  329000.}, {{2013, 8, 31, 0, 0, 0.}, 
  338000.}, {{2013, 8, 31, 0, 0, 0.}, 
  336000.}, {{2013, 8, 31, 0, 0, 0.}, 
  328000.}, {{2013, 9, 30, 0, 0, 0.}, 
  307000.}, {{2013, 9, 30, 0, 0, 0.}, 
  318000.}, {{2013, 9, 30, 0, 0, 0.}, 
  316000.}, {{2013, 9, 30, 0, 0, 0.}, 
  318000.}, {{2013, 10, 31, 0, 0, 0.}, 
  362000.}, {{2013, 10, 31, 0, 0, 0.}, 
  355000.}, {{2013, 10, 31, 0, 0, 0.}, 
  347000.}, {{2013, 10, 31, 0, 0, 0.}, 
  346000.}, {{2013, 11, 30, 0, 0, 0.}, 
  341000.}, {{2013, 11, 30, 0, 0, 0.}, 
  342000.}, {{2013, 11, 30, 0, 0, 0.}, 
  332000.}, {{2013, 11, 30, 0, 0, 0.}, 
  324000.}, {{2013, 11, 30, 0, 0, 0.}, 
  317000.}, {{2013, 12, 31, 0, 0, 0.}, 
  358000.}, {{2013, 12, 31, 0, 0, 0.}, 
  368000.}, {{2013, 12, 31, 0, 0, 0.}, 
  339000.}, {{2013, 12, 31, 0, 0, 0.}, 344000.}}
$\endgroup$
2
  • $\begingroup$ It is nearly 5 years since I wrote that function but as described in the abstract on the download page it is intended as a "How To" to enable you to write your own function(s). The example uses only monthly data. You will have to make the relevant adjustments to the code to include weekly data. $\endgroup$ Commented Dec 15, 2014 at 1:04
  • $\begingroup$ Thanks, @MikeHoneychurch, for the great package. It is very well documented. I just had to copy the FRED function to a new function (I called FREDw) and delete the /. dateRules to keep the original dates. $\endgroup$
    – DrPositron
    Commented Dec 15, 2014 at 3:30

1 Answer 1

2
$\begingroup$

The FRED package written by @MikeHoneychurch is very well documented, and all that was necessary to make the FRED function work for weekly data was to delete the /. dateRules step from the end of the data processing.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.