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.

How to graph two time series with different frequent?

Unread postby hardmann » Tue Feb 01, 2022 9:04 pm

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 88 times
US_mGDP_2021Q4.xlsx
(50.27 KiB) Downloaded 95 times
hardmann
 
Posts: 160
Joined: Sat Feb 26, 2011 10:49 pm

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

Unread postby TomDoan » Wed Feb 02, 2022 8:54 am

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

graph(overlay=dots,ovsamescale) 2
# monthly
# quarterly
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

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

Unread postby hardmann » Sat Feb 05, 2022 7:30 am

Dear Tom:

Sorry, it doesn't work.

Hardmann
hardmann
 
Posts: 160
Joined: Sat Feb 26, 2011 10:49 pm

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

Unread postby TomDoan » Sat Feb 05, 2022 1:37 pm

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
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

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

Unread postby hardmann » Sat Feb 05, 2022 6:07 pm

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 1505 times
hardmann
 
Posts: 160
Joined: Sat Feb 26, 2011 10:49 pm

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

Unread postby TomDoan » Sat Feb 05, 2022 8:50 pm

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.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

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

Unread postby hardmann » Wed Feb 09, 2022 9:55 am

Dear Tom:

Thanks.

Hardmann
hardmann
 
Posts: 160
Joined: Sat Feb 26, 2011 10:49 pm


Return to Graphics, Reports, and Other Output

Who is online

Users browsing this forum: No registered users and 1 guest

cron