Dear all, I've fitted a lm using 61 data (training data), and I'left 10 as test data.
Training data and test data are stored in an excell. training <- read.xls("C:/...../training.xls") , the same for test. That is: v1 v2 ... v15 When I type str(training) and str(test), both sets have the same names The resulting model is lms <- lm(vd ~ log(v1) + fv2+ fv5+ fv7 ) -fvi means they were turned into factors- plms<- predict(lms, new=test ,interval="prediction") Error at model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels) : length of the variables are different (found for 'fv2') More: Warning messages lost 'newdata' had 10 rows but variable(s) found have 61 rows q1: What does it mean? q2: Do I have to change test data names, so they have the same as the resulting lm? q3: Do I have to do anything special because of the log transformation? q4: Afterwards I'd like to plot it, is this way?: plot(plms) Thanks in advance, u...@host.com -- View this message in context: http://r.789695.n4.nabble.com/predict-lm-How-to-introduce-new-data-tp3399582p3399582.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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.