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

st: Adding R-Squared to sw command output


From   Rena Jenkins <[email protected]>
To   [email protected]
Subject   st: Adding R-Squared to sw command output
Date   Thu, 27 May 2004 15:53:32 +0100

Is there a Stata programming guru out there who could help me modify the sw command so that the R-squared of the model is output at each stage? (I am just running a linear regression.)  i.e. to print the value of e(r2) at each stage.

So that when you run something like
sw regress y x1 x2 x3, pe(0.05)

Instead of
                      begin with empty model
p = 0.0032 <  0.0500  adding   x2
p = 0.0153 <  0.0500  adding   x1
p = 0.0424 <  0.0500  adding   x3

You get something like:
                      begin with empty model
p = 0.0032 <  0.0500  adding   x2, R-squared = 0.2018
p = 0.0153 <  0.0500  adding   x1, R-squared = 0.2523
p = 0.0424 <  0.0500  adding   x3, R-squared = 0.2852

I have had a go at making a copy of sw.ado (swr.ado, say) and
trying just to run the copy with minimal alterations. I couldn't
even do that, so I need some help here.

I'm hoping that this would be easy to do for someone more
knowledgeable than I am.

Thanks in advance and kind regards

Rena


___________________________________________________ 
Take your business online with Officemaster. Sign up for a free trial today!

http://www.officemaster.net

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