Statalist


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

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


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

Yes, that solves the problem. Thank you!
Chris

2009/8/13 Martin Weiss <martin.weiss1@gmx.de>:
>
> <>
>
>
> -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: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Stata Chris
> Sent: Donnerstag, 13. August 2009 21:00
> To: statalist@hsphsun2.harvard.edu
> 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/
>

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