![Statalist](/includes/images/head_statalist.jpg) |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Standard error of the estimate for svy: reg
Lineless Line
Here is a program to compute an estimate and C.I. for the RMSE or SER
after -svy: reg- . I did not apply a bias correction for the number
of predictors because I don't know how to do it. However the bias
should be small for large sample size. The concerns that Stas and I
have about presenting this estimate still apply.
Steve
/***************************CODE FOLLOWS***************/
/* 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
display "number of predictors = " e(df_m)
gen resid= weight-predicted
gen resid2=resid*resid
svy: mean resid2
nlcom .5*log(_b[resid2])
antilog
*
* 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/