Displaying 1 result from an estimated 1 matches for "6x51".
Did you mean:
0x51
2006 May 19
1
How to use lm.predict to obtain fitted values?
...d = predict.lm(model,data.frame(x=newData));
Warning message:
'newdata' had 6 rows but variable(s) found have 51 rows.
> pred = predict.lm(model,data.frame(newData));
Warning message:
'newdata' had 6 rows but variable(s) found have 51 rows.
y is a vector of length 51.
x is a 6x51 matrix
newdata is a matrix of the explanatory variables I'd like a prediction for.
The predict.lm function is giving me 51 (=number of observations I had)
numbers, rather than the one number I do want - the predicted value of y,
given the values of x I have supplied it.
Many thanks,
R