<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { margin-top: 0 ; margin-bottom: 0 }
--></style><title>cross-validation</title></head><body>
<div><br></div>
<div>The function crossval (in library bootstrap)</div>
<div>works well for the first degree polynomial model,</div>
<div>but in the case of the second degree model I got</div>
<div>an error message (see below).</div>
<div><br></div>
<div>I would be very greatfull if somebody could</div>
<div>give some advices for the following:</div>
<div><br></div>
<div><font face="Times New Roman" size="+1" color="#000000"><br>
</font><font face="Times" size="+1" color="#000000">>
library(bootstrap)<br>
><br>
> x<-c(22,23.4,24.9,28.5,29.8,31.6,34.2,36.4,37.7,39)<br>
> y<-c(96,88,105,111,107,113,132,122,135,131)<br>
><br>
> theta.fit<-function(x,y){lsfit(x,y)$coef}<br>
> theta.predict<-function(fit,x){<br>
+ cbind(1,x) %*% fit}<br>
<br>
> results <-
crossval(cbind(x,x^2),y,theta.fit,theta.predict)<br>
Error in cbind(1, x) %*% fit : non-conformable arguments<br>
</font></div>
<div><font face="Times" size="+1" color="#000000">Tapio
Nummi</font></div>
<div><font face="Times" size="+1" color="#000000">University of
Tampere</font></div>
<div><font face="Times" size="+1" color="#000000">Finland</font></div>
<div><font face="Times" size="+1" color="#000000"><br></font></div>
</body>
</html>