PRESS Calculation After Linreg
Posted: Wed Nov 20, 2013 1:20 pm
Is there a simple procedure for validating a linear regression with the predicted regression error sum of squares (PRESS) statistic other than writing code like
make x
# x1 x2
compute h =x*inv(tr(x)*x)*tr(x)
compute press =0.0
do i=1,N
compute press =press+(%resids(i)/(1-h(i,i)))^2
end do i
display press
The PRESS statistic is based on the leave-one-out validation approach and was published by
Allen, D. M. (1974), "The Relationship Between Variable Selection and Data Augmentation and a Method for Prediction," Technometrics, 16, 125–127
Thanks,
Ken Cogger.
make x
# x1 x2
compute h =x*inv(tr(x)*x)*tr(x)
compute press =0.0
do i=1,N
compute press =press+(%resids(i)/(1-h(i,i)))^2
end do i
display press
The PRESS statistic is based on the leave-one-out validation approach and was published by
Allen, D. M. (1974), "The Relationship Between Variable Selection and Data Augmentation and a Method for Prediction," Technometrics, 16, 125–127
Thanks,
Ken Cogger.