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: RE: RE: RE: RE: RE: Extracting results from -rolling- in one file per window


From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: RE: RE: RE: RE: Extracting results from -rolling- in one file per window
Date   Mon, 17 Mar 2014 01:24:14 +0000

Micha,

As a global macro, -counter- must be referenced by $counter not by 'counter'. Also, don't initialize counter with "0" but rather with =0. I think the correct syntax is in my previous post.

Joe
________________________________________
From: [email protected] [[email protected]] on behalf of Micha Schildmann [[email protected]]
Sent: Sunday, March 16, 2014 9:13 PM
To: [email protected]
Subject: st: RE: RE: RE: RE: Extracting results from -rolling- in one file per window

Dear Joe,

again your reply was most welcomed. I tried the following code

global counter "0"
capture program drop rollingwindow
program rollingwindow

global counter=`counter'+1
global tflist ""


foreach var of varlist *SA{
reg Mid `var'
tempfile tfcur
parmest, idstr("`var'") saving(`"`tfcur'"', replace) flis(tflist)
}
preserve
clear
append using $tflist
sencode idstr, gene(xvar)
lab var xvar "X-variable"
keybygen xvar, gene(parmseq)
drop if parmseq==2
egen rank = rank (-t)
drop if rank>30
save `counter', replace
restore
end


rolling, window(4) stepsize (4) recursive: rollingwindow

but I get the following error

    - save `counter', replace
    = save , replace
invalid file specification

when enabling trace.

This confuses me as I tried something very similar and it worked.

Do you or anyone else have any idea what could cause this error?

Best regards
Micha

*
*   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/

*
*   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