Jumlong Vongprasert
2010-Oct-16 07:27 UTC
[R] Error in eval(expr, envir, enclos) : object 'x' not found
Dear all I tried to use regression to predicted mu data, but it has error like this:> IWJR.completex y [1,] 33.17635 2.4705021 [2,] 81.61225 3.3815620 [3,] 65.47392 1.6518975 [4,] 57.97806 1.6110785 [5,] 76.05528 2.1601246 [6,] 41.36090 1.5498132 [7,] 68.77844 2.8078691 [8,] 55.57040 2.1183063 [9,] 41.29287 1.8015709 [10,] 65.43935 2.3483183 [11,] 22.44821 2.6010397 [12,] 44.45819 1.5806874 [13,] 35.95592 3.1190134 [14,] 67.51238 2.0328512 [15,] 27.31641 1.7261528 [16,] 37.01328 2.4907096 [17,] 36.14256 2.6417338 [18,] 55.04061 2.3596178> predict(lm(x~y),IWJR.complete)Error in eval(expr, envir, enclos) : object 'x' not found>I'm trying to find answers to solve my problem, but I cann't found what I want to solve the problem. What do I have to do to solve this problem. Thank you very much. Jumlong -- Jumlong Vongprasert Institute of Research and Development Ubon Ratchathani Rajabhat University Ubon Ratchathani THAILAND 34000 [[alternative HTML version deleted]]
Peter Dalgaard
2010-Oct-16 07:40 UTC
[R] Error in eval(expr, envir, enclos) : object 'x' not found
On 10/16/2010 09:27 AM, Jumlong Vongprasert wrote:>> predict(lm(x~y),IWJR.complete) > Error in eval(expr, envir, enclos) : object 'x' not found >> > > I'm trying to find answers to solve my problem, but I cann't found what I > want to solve the problem. > What do I have to do to solve this problem.First isolate it. Break things down into steps by rewriting as fit <- lm(x~y) predict(fit, IWJR.complete) I think you will find that it fails already in the first step, because you didn't tell lm where to look for its variables (it's not going to try guessing it from context, and besides it might not be intended to use the same data as used for prediction). -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com