[R] To convert a quarterly data to a monthly data.

Yuan, Rebecca rebecca.yuan at bankofamerica.com
Wed Feb 20 21:21:55 CET 2013


Hello Rolf,

Thanks for your kind reply!

I figured out there is a function splint in fields that can do the cubic spine interpolation which would enable me to get the monthly series from the quarterly series.

Problem solved.

Here is the code I use the do the task:

out <- cbind(out, splint(qtrly$rDate, qtrly[,names(qtrly)[i]] ,subset(mthly, rDate <= max(qtrly$rDate))$rDate ))

where qtrly is the quarterly data and mthly is the monthly data.

Cheers,

Rebecca

-----Original Message-----
From: Rolf Turner [mailto:rolf.turner at xtra.co.nz] 
Sent: Wednesday, February 20, 2013 3:14 PM
To: Yuan, Rebecca
Cc: R help
Subject: Re: [R] To convert a quarterly data to a monthly data.



This question doesn't make a lot of sense to me.  What do you expect/want your "XXX" values to be?  If you only know that the value for the first quarter was 100, you cannot infer the individual values for January, February and March.  All you know is that these values sum to 100.

     cheers,

         Rolf Turner

On 02/21/2013 08:15 AM, Yuan, Rebecca wrote:
> Hello,
>
> I have a data set has
>
> 2001Q1                                 100
> 2001Q2                                 101
> 2001Q3                                 120
> 2001Q4                                 103
> ...
>
>
> And would like to convert it to a monthly data. i.e.
>
> 200101                                  XXX
> 200102                                  XXX
> 200103                                  XXX
> 200104                                  XXX
> 200105                                  XXX
> 200106                                  XXX
> 200107                                  XXX
> 200108                                  XXX
> 200109                                  XXX
> 200110                                  XXX
> 200111                                  XXX
> 200112                                  XXX
>
> I googled for "convert quarterly data to monthly data R" but most search results shows how to convert monthly data to quarterly data, not the way I need.
>
> Is there any library or function in R can do that?
>
> Thanks very much!
>



----------------------------------------------------------------------
This message, and any attachments, is for the intended r...{{dropped:2}}



More information about the R-help mailing list