Adding SE's in @REGACTFIT

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.
ac_1
Posts: 495
Joined: Thu Apr 15, 2010 6:30 am

Adding SE's in @REGACTFIT

Unread post by ac_1 »

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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Adding SE's in @REGACTFIT

Unread post by TomDoan »

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.
Post Reply