[R] prediction of non-numeric values

Saket Joshi joshi at engr.orst.edu
Wed May 29 10:38:24 CEST 2002


Hi,

I used the lm() function to fit a linear model to a set of items that I
got from a file using the read.table() function.

The response variable in this case is non-numeric.

When I used some of the data in the same file and tried to predict the
response variable for the first 5 rows by doing:

> pred <- predict(model, newdata)
> pred
        1         2         3         4         5
37.890006 82.584161 30.794062  3.796456 41.568923

The predictions should have been those non-numeric values that were in the
response variable field when I fitted the model. Now I want to compare and
see if the predictions are correct. Can someone tell me how to extract
those non-numeric values from this.

Thanks in advance.
-Saket.



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list