[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Steven Samuels <sjhsamuels@earthlink.net> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: adjusted R2 in survey regression |

Date |
Wed, 15 Oct 2008 11:11:35 -0400 |

-Steve **************************CODE BEGINS************************** /* Program to Compute Adjusted R Square for -svy: reg- */ capture program drop _all webuse nhanes2, clear svy : reg weight height predict double resid, residual

tempvar v1 v2 sd1 sd2 adjr2 gen `v1' = e(N)*el(e(V_srs),1,1) gen `sd1' = sqrt(`v1') gen `v2' = e(N)*el(e(V_srs),2,2) gen `sd2' = sqrt(`v2') gen `adjr2'= 100* (1-`v2'/`v1') label var `v1' "Est Pop Variance" label var `v2' "Est Residual Var" label var `sd1' "Est Pop SD" label var `sd2' "Est Resid SD" label var `adjr2' "Adjusted R-Sq (%)" format `v1' `v2' `sd1' `sd2' `adjr2' %10.1f

***************************CODE ENDS*************************** On Oct 15, 2008, at 4:35 AM, Maarten buis wrote:

--- "Aca N.T." <acant29@gmail.com> wrote:I'm puzzled with model building using -svy: reg- for there is no adjusted R squared produced. Is there an alternative test for this?Yes, it's called theory. Add the variable in whose effect you are interested and add variables you think influence both the variable of interest and the dependent variable. Do _not_ add variables that are influenced by the variable of interest and in turn influence the dependent variable. In other words add confounding variables but not intervening variables. -- Maarten

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: adjusted R2 in survey regression***From:*"Aca N.T." <acant29@gmail.com>

**References**:**Re: st: adjusted R2 in survey regression***From:*Maarten buis <maartenbuis@yahoo.co.uk>

- Prev by Date:
**Re: st: weights panel-survey data** - Next by Date:
**st: hw advice wanted** - Previous by thread:
**Re: st: adjusted R2 in survey regression** - Next by thread:
**Re: st: adjusted R2 in survey regression** - Index(es):

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