Hi, I'm trying to get cross validation error for a simple linear regression model, using function CVlm from package DAAG. I would need also the MSE errors for each fold, because I want to test the one standard error rule. My code is
a=c(0.0056, 0.0088, 0.0148, 0.0247, 0.0392, 0.0556, 0.0632, 0.0686, 0.0786, 0.0855, 0.0937) b=c(6.0813, 9.5011, 15.5194, 23.9409, 32.8492, 40.8399, 43.8760, 45.5270, 46.7668, 46.1587, 43.4524) dataset=data.frame(x=a,y=b) CV.list=CVlm(df=dataset,form.lm = formula(y ~ poly(x,2)), m=5) The error I get is Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ which must refer to internally created x, y, variables, since the variables x and y inside my dataframe have the same length. Thanks Sergio [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.