0

I am applying the cv.glm() function from the {boot} package. The command is working perfectly fine, but I am trying to obtain the seed on which the my K fold cross validation was established to be able to reproduce the results. Here's an example (from the MASS package data) of what I have:

data(mammals, package="MASS")
model <- glm(log(brain) ~ log(body), data = mammals)
result <- cv.glm(mammals, model, K=10)

When I execute result$seed I get a vector of length 626. What seed have I exactly used here?

Thanks a lot.

Error404
  • 6,959
  • 16
  • 45
  • 58
  • 2
    Set the seed before conducting the analysis. – Roland Feb 10 '14 at 10:32
  • Oh I see, that worked. Thanks. Would you like to rewrite it as an answer? :) – Error404 Feb 10 '14 at 10:35
  • I expect it is the same as the `.Random.seed` variable. It is not possible to get the *single* value of `set.seed` that produced this, see: http://stackoverflow.com/a/19614429/269476 – James Feb 10 '14 at 10:40
  • I thought so, but this would be a good explanation if someone is struggling with `cv.glm()` in particular – Error404 Feb 10 '14 at 11:00

0 Answers0