Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: measures of fit using svy:regress


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: measures of fit using svy:regress
Date   Sat, 22 Dec 2007 17:02:31 -0500

You can estimate adjusted r-square directly as Adj R2 = 1- (residual SD^2)/var(Y)



Estimate of var(Y). See:
http://www.stata.com/support/faqs/stat/supweight.html
for an estimate of the SD of Y.

For an estimate of the Residual SD
Here's a method I previously posted to compute the Residual SD and a CI for it. If you incorporated the formula for the population variance into nlcom, you could get a CI for the ratio of (residual Var)/Var(Y) and thus a CI of your adjusted R2.

/***********************************CODE STARTS**********************************************************/
/* First, a program to compute a 95% CI after -nlcom- has estimated a parameter on the log scale*/

capture program drop _all
program antilog
local lparm el(r(b),1,1)
local se sqrt(el(r(V),1,1))
local bound invttail(e(df_r),.025)*`se'
local parm exp(`lparm')
local ll exp(`lparm' - `bound')
local ul exp( `lparm' + `bound')
di "parm =" `parm' " llim = " `ll' " ul = " `ul'
end

webuse nhanes2, clear
svyset
svy : reg weight height
predict predicted

gen resid= weight-predicted
gen resid2=resid*resid

svy: mean resid2
nlcom .5*log(_b[resid2]) //residual SD
nlcom log(_b[resid2]) //residual variance


antilog

/***************************CODE ENDS****************************************************/
On Dec 21, 2007, at 10:08 PM, [email protected] wrote:


I am using svy: regress. Are there other measures of fit available besides R-
squared? Can I obtain the adjusted R-squared or root MSE?

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