Hi Tom,
I'd like to add SE's to the residuals in @REGACTFIT for use with BOXJENK, LINREG and VAR's.
Is this as straightforward as the following:
* Actual vs fitted and residuals
spgraph(hea='y\\Top panel: Actual vs fitted\\Bottom panel: Residuals',vfi=1,hfi=1)
set fitted = %eqndepvar(0){0}-resids
compute depvar=%eqndepvar(0)
sstats(mean) %regstart() %regend() resids>>mu_resids
set Upp %regstart() %regend() = mu_resids + sqrt(%seesq)
set Low %regstart() %regend() = mu_resids - sqrt(%seesq)
graph(overlay=line,ovrange=.5,ovcount=2,vlabel='Residuals',ovlabel='Actual/Fitted',key=below) 5
# resids
# Upp %regstart() %regend()
# Low %regstart() %regend()
# depvar %regstart() %regend()
# fitted
spgraph(done)
Thanks,
Amarjit
Adding SE's in @REGACTFIT
Re: Adding SE's in @REGACTFIT
That's a simple approach to it. In sample, you have the more complicated functions for standard errors which take into account the x's for the observation. However, if you are graphing white noise with upper and lower bands, you get an unreadable blob unless you only have maybe 40 data points.