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: rollreg


From   Timothy King <T.P.King@leeds.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: rollreg
Date   Mon, 16 Dec 2013 17:17:07 +0000

Dear Statalist,

I am trying to run a rollreg example that performs a rolling regression for each company but get the error message:

'too few quotes'. I can't spot the source.

The code is as follows:

* rollreg by firm
set more off
webuse invest2, clear
tsset company time
rollreg market L(0/1).invest time, move(8) stub(mktM)
local dv `r(depvar)'
local rl `r(reglist)'
local stub `r(stub)'
local wantcoef invest
local m "`r(rolloption)’(`r(rollobs)’)"
forv i=1/4 {
qui reg `dv' `rl' if company==`i'
local cinv = _b[`wantcoef']
tsline `stub'_`wantcoef' if company==`i' & `stub'_`wantcoef'<., ///
ti("company `i'") yli(`cinv') yti("moving beta") ///
name(comp `i’,replace) nodraw
local all "`all' comp`i'"
}
graph combine `all’, ti("`m’ coefficient of `dv’ on `wantcoef’") ///
ysize(4) xsize(4) col(2) ///
t1("Full-sample coefficient displayed") saving("`wantcoef’.gph",replace)

Thank you in advance,

Tim

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