Statalist


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

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


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: reg ..., noc if... ?
Date   Thu, 13 Aug 2009 21:03:23 +0200

<>


-If- qualifiers go before the comma, they are not part of the options, but a
category in its own right...

HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Stata Chris
Sent: Donnerstag, 13. August 2009 21:00
To: [email protected]
Subject: st: reg ..., noc if... ?

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/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index