Displaying 1 result from an estimated 1 matches for "mmn2".
Did you mean:
mm2
2010 Jan 18
2
Predict polynomial problem
..., and also on R 2.8.1 I had
lying around on a Windows box:
d = data.frame(x=1:10,y=runif(10))
lmn <- function(d,n){
models=list()
for(i in n){
models[[i]]=lm(y~poly(x,i),data=d)
}
return(models)
}
mmn = lmn(d,3)
predict(mmn[[3]])
predict(mmn[[3]],newdata=data.frame(x=c(9,10,11)))
mmn2 = lmn(d,3:5)
predict(mmn2[[3]])
predict(mmn2[[3]],newdata=data.frame(x=c(9,10,11)))
Barry