Page 1 of 1

spgraph different from excel

Posted: Tue Dec 26, 2017 3:23 am
by ege_man
Dear Tom,
As you know colorured graphs are not accepted by journals. So I was planing to produce a good-looking time-varying variance-decomposition graph for different horizons. But the graph at h=1 in the first pane is different from excel, there is a problem with the contribution of ip. There is no problem with the other horizons.

The code is below and the data and graph are attached.

Happy new year

Code: Select all

open data 2017_dec_26_oil_stock_vardec.xlsx
calendar(m) 1988
data(format=xlsx,org=columns) 1988:05 2017:03
table

compute [vect[strings]] implabel=|| "poil","rer", "ip", "int", "ret"||
spgraph(hfields=2, vfields=2, header="Variance Decomposition of Stock Returns")
GRAPH(STYLE=stacked,pattern, header= 'h=1', klabel=implabel, key=below, max=1.0, min=0.0) 5
# POIL_VD1
# RER_VD1
# IP_VD1
# RINT_VD1
# RET_VD1
GRAPH(STYLE=STACKED, header= 'h=4', pattern, klabel=implabel, key=below, max=1.0, min=0.0) 5
# POIL_VD4
# RER_VD4
# IP_VD4
# RINT_VD4
# RET_VD4
GRAPH(STYLE=STACKED, header= 'h=6', pattern, klabel=implabel, key=below, max=1.0, min=0.0) 5
# POIL_VD6
# RER_VD6
# IP_VD6
# RINT_VD6
# RET_VD6
GRAPH(STYLE=STACKED, header= 'h=12', pattern, klabel=implabel, key=below, max=1.0, min=0.0) 5
# POIL_VD12
# RER_VD12
# IP_VD12
# RINT_VD12
# RET_VD12
spgraph(done)

Re: spgraph different from excel

Posted: Tue Dec 26, 2017 7:45 am
by TomDoan
The problem isn't the contribution of IP---the problem is that the crosshatch pattern used for #5 black and white doesn't have enough room to actually make the crosshatch pattern visible. Redefine the #5 B&W fill as (say) 25% gray (which is a very dark gray, but not black).

Re: spgraph different from excel

Posted: Tue Dec 26, 2017 4:29 pm
by ege_man
Dear Tom,
Thanks I looked the introduction pdf and change the degree of gray, but changing pattern or gray do not solve the problem. If you look at the rgf graph file attached you will see that there is no problem with h=4 h=6 and h=12.
Regards