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]

st: How to use elements of a matrix as constraints in cnsreg


From   "Steve Martin" <[email protected]>
To   <[email protected]>
Subject   st: How to use elements of a matrix as constraints in cnsreg
Date   Thu, 11 Aug 2011 17:53:34 +0100

I am using Stata 11.  I have a matrix D

. matrix list D

D[2,1]
                random
llonepenhx  -.43352401
  lIMD2007  -.19335928

I want to estimate a constrained regression where the values of certain
elements of the matrix D serve as constraints in a regression.  In
particular, I would like to constrain the coefficient on llonepenhx to be
equal to -0.43352401 and the coefficient on lIMD2007 to be -0.19335928.

Trying

constraint 1 llonepenhx=D[1,1]
constraint 2 lIMD2007=D[2,1]
cnsreg yvar x1var x2var llonepenhx  lIMD2007, constraints(1-2)

results in 

(note: constraint number 1 caused error r(131))
(note: constraint number 2 caused error r(131))

Suggestions please.  Thanks.

Steve

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