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

From |
"Aca N.T." <acant29@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

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

Date |
Thu, 16 Oct 2008 07:38:00 +0700 |

Thanks Steve! Aca. On Wed, Oct 15, 2008 at 10:11 PM, Steven Samuels <sjhsamuels@earthlink.net> wrote: > Below is a do-file which will calculate the adjusted R-square and related > statistics after -svy: reg-. The statistics are computed as temporary > variables and are displayed with Nick Cox's -dlist- command, downloadable > from SSC. Be sure to zap gremlins in your text editor before running the > code. I agree with Maarten that theory-based choice of predictors is a > necessity. > > -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 > > svy: mean weight resid // substitute the response variable for "weight" > here" > 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 > > dlist `v1' `v2' `sd1' `sd2' `adjr2' in 1, name(0) // -dlist- by Nick Cox > from SSC > ***************************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/ > * * 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/

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

**Re: st: adjusted R2 in survey regression***From:*Steven Samuels <sjhsamuels@earthlink.net>

- Prev by Date:
**Re: st: adjusted R2 in survey regression** - Next by Date:
**st: Endogenous switching regression for a binary outcome** - Previous by thread:
**Re: st: adjusted R2 in survey regression** - Next by thread:
**Re: st: adjusted R2 in survey regression** - Index(es):

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