<$BlogRSDUrl$>

Monday, September 29, 2008

Correct me if I'm wrong, but isn't the point of fitting the linear model to make predictions for the unknown values of newAccounts? In the example, "trainingData" contains all rows of "data" that do not have "NA" as newAccount, and the predict function is called on the other 33 rows to try to produce the predictions for them (It works fine with the standard lm). Calling predict on trainingData would produce 200 predictions for the rows for which we have actual observable newAccounts data, but is that what we want?

If trainingData has 233 rows, the calling predict on trainingData will
generate 233 predicted values of which you are interested in the last 33.
Alternatively you could call predict on trainingData[is.na(newAccounts),] which will
generate 33 predictions only.

This page is powered by Blogger. Isn't yours?