How to graph two time series with different frequent?

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
hardmann
Posts: 247
Joined: Sat Feb 26, 2011 9:49 pm

How to graph two time series with different frequent?

Unread post by hardmann »

Dear Tom:

How to graph two time series with different frequent? Firstly, we have quarterly GDP. Secondly, The series was rearranged, so it can be read into the monthly frame with data only for the final month of each quarter i.e. data is placed in March, June, September, and December respectively. We use @disaggregate procedure to get monthly GDP. We want to plot quarterly GDP in line merely with 3,6,9,12 months. How can we compare them in a same graph or special graph (spgraph)?




Best Regard
Hardmann
Attachments
disaggregate qgdp into mgdp.RPF
(3.19 KiB) Downloaded 908 times
US_mGDP_2021Q4.xlsx
(50.27 KiB) Downloaded 926 times
TomDoan
Posts: 7777
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to graph two time series with different frequent?

Unread post by TomDoan »

Probably the best thing to do is use the DOTS style for an overlay:

graph(overlay=dots,ovsamescale) 2
# monthly
# quarterly
hardmann
Posts: 247
Joined: Sat Feb 26, 2011 9:49 pm

Re: How to graph two time series with different frequent?

Unread post by hardmann »

Dear Tom:

Sorry, it doesn't work.

Hardmann
TomDoan
Posts: 7777
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to graph two time series with different frequent?

Unread post by TomDoan »

Works fine in you restrict the range. If you graph the entire range, the series are so close together that the graphs won't be clearly different.

graph(overlay=dots,ovsamescale) 2
# mgdp_rw1 2010:1 2015:4
# gdp 2010:1 2015:4
hardmann
Posts: 247
Joined: Sat Feb 26, 2011 9:49 pm

Re: How to graph two time series with different frequent?

Unread post by hardmann »

Dear Tom:

Yes, I do. In my code, I use

GRAPH(STYLE=LINE,OVERLAY=dot,ovsamescale,KEY=BELOW) 2
# MGDP 1947:01 1950:12
# GDP 1947:01 1950:12

In fact, I want to get two lines., graph attached is done by MS EXCEL.
I want to graph directly by Rats.

Best Regard
Hardmann
Attachments
BC Q&M.png
BC Q&M.png (538.33 KiB) Viewed 35985 times
TomDoan
Posts: 7777
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to graph two time series with different frequent?

Unread post by TomDoan »

If you do lines, it will do ---- lines in connecting the quarterly numbers. I'm really not sure why you would want to do lines connecting the quarterly numbers. You've gone to considerable effort to come up with a monthly distribution of the GDP numbers and then you want to show them the same way as a strictly artificial linear interpolation.
hardmann
Posts: 247
Joined: Sat Feb 26, 2011 9:49 pm

Re: How to graph two time series with different frequent?

Unread post by hardmann »

Dear Tom:

Thanks.

Hardmann
Post Reply