Is LOOCV something like this?
sysuse auto,clear
count
tempvar mse
gen `mse' = .
qui {
forv i = 1/`=r(N)' {
reg mpg gear if _n != `i'
predict res if _n != `i', res
replace res = res^2
sum res, meanonly
replace `mse' = r(mean) in `i'
drop res
}
sum `mse'
}
disp "MSE (LOOCV) = "r(mean)
Scott
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Randolph M Siverson
> Sent: Tuesday, October 04, 2005 2:40 PM
> To: [email protected]
> Subject: st: Leave one out
>
> Does anyone know of ado files written to perform Leave One Out Cross
> Validation (LOOCV)?
>
> Randolph M. Siverson
> Professor of Political Science and
> Director, International Relations Program
> University of California, Davis
> Davis, CA 95616
> 530-752-3078, voice and fax
>
>
*
* 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/