[R] predicting non-numeric values

Saket Joshi joshi at engr.orst.edu
Sun Jun 2 02:05:20 CEST 2002


Hi all,

I had asked a question a few days ago on this list. I did not receive an
answer. Since it was important to me, I looked for the answer in some
references but as I am not really a statistics guy, the jargon was
overwhelming for me. I apologize if this question is too trivial.

Here is the question again:

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