SHAZAM Questions and Answers (Q&A) - RSS feedhttp://community.econometrics.com/questions/SHAZAM Econometrics, Statistics and Analytics Communityen<font color="white">Copyright <b>SHAZAM Analytics, 2018</b></font>Thu, 02 Feb 2017 13:22:31 +0000How to organize time series and make nice figureshttp://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/Hi all,
I have a single time series "A", and the length of the series is 32 years. The series start in 1983 and last observation is in 2014. The single time series "A" store in a separate file. I have a multi series 1, 2, 3, 4, ….N which are generated series. They are stored in B and with length 50 years.
Problem: How can I stack the **single** series A (1x32) and the **multi series** B (Nx50) with A on the **top**, and GRAPH the time series? **Note** that the single series A starts in 1983 ends in 2014 and the multi-series starts in 2015.
Regards,
TL
Mon, 30 Jan 2017 20:44:36 +0000http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/Answer by SHAZAMHelp for <p>Hi all,</p>
<p>I have a single time series "A", and the length of the series is 32 years. The series start in 1983 and last observation is in 2014. The single time series "A" store in a separate file. I have a multi series 1, 2, 3, 4, ….N which are generated series. They are stored in B and with length 50 years. </p>
<p>Problem: How can I stack the <strong>single</strong> series A (1x32) and the <strong>multi series</strong> B (Nx50) with A on the <strong>top</strong>, and GRAPH the time series? <strong>Note</strong> that the single series A starts in 1983 ends in 2014 and the multi-series starts in 2015. </p>
<p>Regards,
TL</p>
http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?answer=739#post-id-739One simple way would be to insert the same observed values A into all the columns of B series before the generated data. When plotted there would be one line up until start of B after which the lines would show the differences.Tue, 31 Jan 2017 20:30:59 +0000http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?answer=739#post-id-739Comment by SHAZAMHelp for <p>One simple way would be to insert the same observed values A into all the columns of B series before the generated data. When plotted there would be one line up until start of B after which the lines would show the differences.</p>
http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?comment=744#post-id-744Here is how to combine 2 series and graph them
* Create A series
sample 1 5
genr a = time(0)
print a
* Create B series
sample 1 15
genr b = time(10)
print b
* Convert series to matrices and concatenate
matrix a1 = a
matrix b1 = b
matrix c1 = a1'|b1'
matrix c = c1'
print c1 c
* Graph the combined data
graph c / lineWed, 01 Feb 2017 23:34:56 +0000http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?comment=744#post-id-744Comment by TL for <p>One simple way would be to insert the same observed values A into all the columns of B series before the generated data. When plotted there would be one line up until start of B after which the lines would show the differences.</p>
http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?comment=743#post-id-743Thanks for your suggestion, The problem is that matrix B is generated as a result of the do-loop simulation process. I think some matrix algebra could solve the problem, but I'm not sure how to do it.Tue, 31 Jan 2017 21:48:50 +0000http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?comment=743#post-id-743Comment by TL for <p>One simple way would be to insert the same observed values A into all the columns of B series before the generated data. When plotted there would be one line up until start of B after which the lines would show the differences.</p>
http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?comment=745#post-id-745Thanks a lot - it works! I have a follow-up question: How do you organize the data (matrix) when matrix B has let's say 5 columns? (and the dimension of B is not changed).Thu, 02 Feb 2017 13:22:31 +0000http://community.econometrics.com/question/738/how-to-organize-time-series-and-make-nice-figures/?comment=745#post-id-745