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

st: Estimating sqreg without a constant


From   Puja Vasudeva <p.vasudeva@sussex.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Estimating sqreg without a constant
Date   Wed, 25 Aug 2004 12:22:39 +0530

Dear Scott,

A very belated thank you for a solution that you gave months ago (and that I could get back to only now). It worked perfectly, thanks!

Puja


Date: Fri, 25 Jun 2004 14:03:22 -0500
From: "Scott Merryman" <smerryman@kc.rr.com>
Subject: st: RE: Estimating sqreg without a constant

Puja,

Could you not add the value of the constant to the estimated dummy variables
(where the dropped dummy variable takes on the value of the constant)?

For example, the following creates a new variable of the fixed-effect for
each company:

use http://www.stata-press.com/data/r8/grunfeld.dta
xi i.com
qui qreg invest mvalue kstock _I*,
gen fe = .
forv i = 1/10 {
qui replace fe = _b[_Icompany_`i'] + _b[_cons] if company == `i'
*local j = `j' +1
}
replace fe =_b[_cons] if company == 1

tabdisp company, c(fe)


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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index