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

Re: st: measures of fit using svy:regress

From   Steven Samuels <>
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:
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'

webuse nhanes2, clear
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


/***************************CODE ENDS****************************************************/
On Dec 21, 2007, at 10:08 PM, 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:
*   For searches and help try:

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