From | Richard Williams <[email protected]> |
To | [email protected] |
Subject | Re: st: Adding R-Squared to sw command output |
Date | Thu, 27 May 2004 10:17:20 -0500 |
At 03:53 PM 5/27/2004 +0100, Rena Jenkins wrote:
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.Rather than replacing sw.ado, I would suggest copying it as sw2.ado, and place it in c:\ado\personal. Change the line that says "program define sw" to "program define sw2". Then, search for the line that includes the word "adding". Replace it with
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
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |