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

st: RE: Fixed intercept in linear regression, How?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Fixed intercept in linear regression, How?
Date   Tue, 27 Aug 2002 13:33:28 +0100

Meng Lu
 
> I'd like to do a linear regression with the intercept fixed 
> at 1, i.e.,
> 
> y = 1 + bx
> 
> I found it's quite simple in SAS and splus to do so, but I 
> was not able
> to figure out how to fullfill this in stata.
> 

Others have suggested the trick of subtracting 1
from the response and using -regress, noconstant-. 

For completeness, I will mention the use of -constraint- 
followed by -cnsreg-. 

The two are not quite equivalent. For example, -cnsreg- 
refuses to print R-squared, which is possibly the better
response in this circumstance. 

Nick 
n.j.cox@durham.ac.uk 
*
*   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