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]

Re: st: constrained regression but one constraint not being implemented


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: constrained regression but one constraint not being implemented
Date   Wed, 23 Mar 2011 16:20:25 +0000

It's at least a quirk that e.g. a reference to `i+1' is interpreted by
Stata as a reference to `i'. That is, the extra characters "+1" are
ignored, and do not trigger an error message. Note that `i1' is a
legal reference to a local macro of that name (and is interpreted as
empty if there is no such macro). It's the "+" that is, or should be,
problematic as such a character can not be part of a Stata name.

But Maarten pointed out, `i + 1' is not equivalent to `i' + 1. As you
want that, you must ask for it directly.

Nick

On Wed, Mar 23, 2011 at 3:49 PM, Maarten buis <[email protected]> wrote:
> --- On Wed, 23/3/11, Steve Martin wrote:
>> Why does the following piece of code only impose the
>> second of the two constraints when estimating the
>> constrained regression
> <snip>
>> constraint `i+1' llonepenhx=1-`i'/10
>> cnsreg lallcancerssyllr68  $xvar [w=raw0607], constraints(`i'-`i+1')
>
> replace `i+1' with `= `i' +1'
>

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index