Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Overwritten?


From   "Francis, Richard N" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Overwritten?
Date   Mon, 30 Dec 2013 21:59:28 +0000

Hi Statalist,

Have an option within a called program -SROOTFIX which generates residuals for a regression command.

However, the variable containing the residuals -RES is absent.

The called program -SROOTFIX actually calls another program -SROOT.

Separate execution of -SROOT retains the residuals variable -RES, which suggests that something within the -SROOTFIX pgm overwrites the residuals variable -RES.

The master program is as follows:

 forval i = 1/`limit' {
         display "Iteration of `i' of `limit"
         replace which = "`: label (id) `i''" in `i'
         srootfix fcf if id == `i' , residuals(res)
		 qui foreach v in Z14 Z24 Z34 Z4t Z3t Z2t Z1t {
                  replace `v' = r(`v') in `i'
         }
}

I have executed the program with the -replace command.

However, the residuals variable -RES continues to be absent.

The contents of -SROOTFIX are as follows:

*! By Sergiy Radyakin, 2013
*! Fixes problem of -if- modifier [suspected] not working in public (SJ) version of -sroot-.
** See http://www.stata.com/statalist/archive/2013-11/msg00366.html

program define srootfix
   version 9.2
   syntax varname(ts) [if] [in] ,[*]
   preserve
   marksample touse
   keep if `touse'
   sroot `varlist' , `options'
end

** end of file **

Any ideas for the absence of the residuals variable -RES are greatly appreciated.

Thank you,

Rick

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index