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: How to compose constraint with a series of variables?


From   Muyang Zhang <[email protected]>
To   [email protected]
Subject   Re: st: How to compose constraint with a series of variables?
Date   Sat, 19 Mar 2011 21:20:05 -0400

I am only imposing one constraint: the sum of those variables is 0.

On Sat, Mar 19, 2011 at 7:43 PM, Nick Cox <[email protected]> wrote:
> You can't, or so I believe. I think the best you can do is to define
> many constraints within a loop. For example, suppose you had variables
> v1-v1000 and you wanted to impose the same constraint on each. A
> skeleton could be
>
> forval i = 1/1000 {
> constraint `i' v`i' = < whatever>
> }
>
> That said, I don't how successful you are likely to be imposing
> hundreds of constraints.
>
> Nick
>
> On Sat, Mar 19, 2011 at 9:56 PM, Muyang Zhang <[email protected]> wrote:
>>
>> I wish to set constraints in regression. I know usually it can be
>> implemented by the -constraint- command.
>>
>> But my problem is that I have a series of variables (over 1000)
>> starting with the same phrase followed by numbers. How can I compose
>> constraints with -*- operator?
> *
> *   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/
>



-- 
Zhang Muyang
China Center for Economic Research
Peking University
Beijing, 100871
China.

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