Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Constraining All variables


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: Constraining All variables
Date   Sun, 5 Dec 2004 06:32:13 -0600

> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of joe J.
> Sent: Sunday, December 05, 2004 5:22 AM
> To: [email protected]
> Subject: st: Constraining All variables
> 
> Dear Statalisters,
> I am estimating three equations in a frontier analysis. The last two
> equations regress ,respectively, mean and variance of the inefficiency on
> the same set of variables. I want to  constrain the coefficients to be
> equal
> across these two equations. However,using the constraint function in
> stata,
> only the coefficient for the first variable is made equal.
> 
> I can illustrate the problem using sureg programme.

<snip>

How something like:

use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear

local i = 1
foreach var in  math science write _cons {
	constraint define `i'  [read]`var' = [socst]`var'
	local const "`const' `i' "
	local i = `i' + 1
	}
disp "`const'"


sureg (read math science write) (socst math science write), const("`const'")


Scott



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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