Statalist


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

st: reg ..., noc if... ?


From   Stata Chris <statachris@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: reg ..., noc if... ?
Date   Thu, 13 Aug 2009 15:00:07 -0400

Dear Statalisters,

I am using the following loop:

gen beta         = .
gen se_beta      = .
gen t_beta       = .
forvalues i=456/515{
  capture noisily {
    reg delta L.delta                               if period==`i'
    replace beta          =  _b[L.delta]       if period==`i'
    replace se_beta       = _se[L.delta]    if period==`i'
    replace t_beta        = beta / se_beta  if period==`i'
  }
}

Now I wanted to impose the constraint on each of the regressions that
the constant should equal zero. However, if I add ",noc" (no
constant), then Stata interprets everything after the comma as an
option and tells me that "if period..." is not a valid option.

So I was wondering if there is any way to have both the noc constraint
and the if condition here?

Many thanks, Chris
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index