[R] calculate RMSE using bootstrap

Thomas Hoffmann thomas.hoffmann at uni-bonn.de
Mon Oct 15 17:18:24 CEST 2012


Dear all,

I need to calculate confidence intervals of a and b and root mean square 
error (RMSE) of a power law given by

Y = a X^b

I calculate the confidence intervals by:

     reg.ln = function(tab.xy, indices){
         tab.xy = storage[indices,]
         res.lm  = lm(log(y)~log(x), data=tab.xy)
         coefficients(res.lm)
     }

     xy.boot = boot(tab.xy, reg.ln, 2000)

     boot.ci(xy.boot)

where tab.xy is a dataframe containing x and y.

Is there any way to calculate the mean RMSE of the 2000 fitted models, 
e.g. identify the data which are not used in the random sub-sample 
generated by boot() and calculate the RMSE of the fitted models.


Kind regards for any help
Thomas



More information about the R-help mailing list