Bookmark and Share

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

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

st: Overwritten?

From   "Francis, Richard N" <>
To   "" <>
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

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

** end of file **

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

Thank you,


*   For searches and help try:

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