Graph editting

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.

Graph editting

Unread postby tyzellar » Sat Jun 25, 2022 6:00 am

Dear Tom, Could you please tell me how could I edit the impulse response functions graphs, in order to be able to clearly distinguish between the two IRF functions and the standard errors. Attached to his post you will also find the code and the dataset.

spgraph(vfields=1,hfields=5)
do j=1,1
dofor i=1 2 4 5
compute factor76 = acresp76(j,j)(1)
set respons76 = acresp76(i,j)/factor76
set stde = sqrt(seconda(t,i+(j-1)*nvars))/factor76
set upp = respons76 + band * stde
set low = respons76 - band * stde
graph(header=implabel(i),hlabel="horizon",number=1) 3
# upp 1 nsteps 2
# low 1 nsteps 2
# respons76 1 nsteps 1
end do i

end do j
print / respons76 upp low
compute j=1

set respons76 = resp76(3,j)/factor76
set stde = sqrt(second(t,3+(j-1)*nvars))/factor76
set upp = respons76 + band * stde
set low = respons76 - band * stde
graph(header=implabel(3),hlabel="horizon",number=1) 3
# upp 1 nsteps 2
# low 1 nsteps 2
# respons76 1 nsteps 1
print / respons76 upp low

spgraph(done)
Last edited by tyzellar on Mon Jun 27, 2022 8:47 am, edited 1 time in total.
tyzellar
 
Posts: 11
Joined: Tue May 17, 2022 7:32 am

Re: Graph editting

Unread postby TomDoan » Sun Jun 26, 2022 9:34 pm

What was it that you wanted to change. The black line with blue upper and lower is pretty standard.
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: Graph editting

Unread postby tyzellar » Mon Jun 27, 2022 2:36 am

In the last part of the code, I insert in one graph two impulse response functions and I get this graph, which is not so clear. I run this code and I receive the following graph. I would like to have two different colors for the IRFs and one color for the confidence bands. Thank you in advance!


spgraph(vfields=1,hfields=5)
do j=1,1
dofor i=1 2 4 5
compute factor85 = acresp85(j,j)(1)
compute factor76 = acresp76(j,j)(1)
do n=1,nsteps
compute respons85(n) = acresp85(i,j)(n)/factor85
compute respons76(n) = acresp76(i,j)(n)/factor76
compute stde(n) = sqrt(seconda(n,i+(j-1)*nvars))/factor85
end do n
set upp = respons85 + band * stde
set low = respons85 - band * stde
graph(header=implabel(i),hlabel="horizon",number=1) 4
# upp 1 nsteps 1
# low 1 nsteps 1
# respons85 1 nsteps 1
# respons76 1 nsteps 2
end do i
end do j
compute j=1

set respons85 = resp85(3,j)/factor85
set respons76 = resp76(3,j)/factor76

set stde = sqrt(second(t,3+(j-1)*nvars))/factor76
set upp = respons85 + band * stde
set low = respons85 - band * stde
graph(header=implabel(3),hlabel="horizon",number=1) 4
# upp 1 nsteps 1
# low 1 nsteps 1
# respons85 1 nsteps 1
# respons76 1 nsteps 2
spgraph(done)
Attachments
two_IRFs_one_graph.png
two_IRFs_one_graph.png (1.09 MiB) Viewed 1319 times
tyzellar
 
Posts: 11
Joined: Tue May 17, 2022 7:32 am

Re: Graph editting

Unread postby TomDoan » Mon Jun 27, 2022 8:01 am

You are using 1 (i.e. black) for upp, low and respons85, while 2 (i.e. blue) for respons76. I would think that using respons85 and respons76 should be something different from each other and from upp and low.

graph(header=implabel(3),hlabel="horizon",number=1) 4
# upp 1 nsteps 1
# low 1 nsteps 1
# respons85 1 nsteps 1
# respons76 1 nsteps 2
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: Graph editting

Unread postby tyzellar » Mon Jun 27, 2022 8:40 am

You are totally right. Thank you very much. I really appreciate your help!
tyzellar
 
Posts: 11
Joined: Tue May 17, 2022 7:32 am


Return to Graphics, Reports, and Other Output

Who is online

Users browsing this forum: No registered users and 1 guest

cron