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

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

From   Stata Chris <>
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                               if period==`i'
    replace beta          =  _b[]       if period==`i'
    replace se_beta       = _se[]    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:

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