[R] Repeated cross-validation for a lm object

samuel-rosa alessandrosamuel at yahoo.com.br
Wed Feb 22 19:20:39 CET 2012

Dear Max and Greg

Thank you for your help. Unfortunately I was not able in getting what I need
using the functions you suggested. I believe it can be a result of my
inexperience with the packages caret and rms. Therefore, I provide more
information about my problem and wish you can again provide me some help.

I already have a single linear regression model fitted to my data (n = 150).
The coefficients of the parameters have been determined using ordinary least
squares. In the next step I want to use another data set (n = 174) to obtain
the validation statistics. For other multivariate linear regression models I
have been using the function lmCV() as follows:

> set.seed(123)
> CV = lmCV(a~b+c, my.data, segments=10, repl=100, segment.type="random")

where the k segments are selected randomly (I need to use a known seed).

CV$predicted gives me the predicted values of "a" as a function of "b" and
"c" for all the n = 174 observations in each of the 100 replications.
However, it does not work for single linear regression models.

I may have made a mistake, but I could not found any function such as
$predicted to get all the 100 predicted values for each of the 174

Hope you can help me once again. 

Best regards,

Bc.Sc.Agri. Alessandro Samuel-Rosa
Postgraduate Program in Soil Science
Federal University of Santa Maria
Av. Roraima, nº 1000, Bairro Camobi, CEP 97105-970
Santa Maria, Rio Grande do Sul, Brazil
View this message in context: http://r.789695.n4.nabble.com/Repeated-cross-validation-for-a-lm-object-tp4394833p4411252.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list