I m new to R..eventhough i managed to do my project..now i need to find prediction error from my predicted data...help me to find.the code which i found prediction is,
set.seed(100)
trainingRowIndex <- sample(1:nrow(kmea), 0.8*nrow(kmea))
trainingData <- kmea[trainingRowIndex, ]
testData <- kmea[-trainingRowIndex, ]
t<-as.data.frame(trainingData)
t1<-as.data.frame(testData)
lmMod<- lm(u1~u2, data=t)
plot(lmMod)
distPred <- predict(lmMod, t1)