spgraph different from excel
Posted: Tue Dec 26, 2017 3:23 am
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
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)