5

I have an old S-plus script, and I would like to reproduce the results in R. The only issue I'm having is the random seed. I know they use different algorithms for the pseudo-random number generation. In the S-plus file the seed was set using:

set.seed(337)

The relevant information I could find is

S-plus set seed

R set seed

From this documentation it looks like S-plus used the "Super-duper" algorithm for pseudo-random number generation. R has this option, but it says it takes in 2 integers, while S-plus only requires 1 integer between 0 and 1000. Furthermore the R doc says

The two seeds are the Tausworthe and congruence long integers, respectively. 
A one-to-one mapping to S's .Random.seed[1:12] is possible but we will not
publish one, not least as this generator is not exactly the same as that in
recent versions of S-PLUS.

I'm not quite sure what this means. So does anyone know if it would be possible to replicate results?

An old post on the R mailing list tries to get same results in S/R/Splus.

bdeonovic
  • 4,130
  • 7
  • 40
  • 70
  • 3
    If all else fails you could write out the random digits S-plus uses to a file and read those into R and use them directly. Obviously not the ideal approach but if you're strapped for time and all else fails... – Dason Sep 12 '16 at 16:52
  • It means that R cannot exactly reproduce S’ random number generator output even if you provided the exact same seed. As an alternative to @Dason’s suggestion you could try reimplementing S’ Super-duper generator in R. This would need to be carefully tested, though. For a single replication, Dason’s suggestion is simpler. – Konrad Rudolph Sep 12 '16 at 17:21
  • 3
    … it should be noted, additionally, that robust results should not/do not rely on identical replication to result in equal results. Your mileage may vary, but this is generally a reason to doubt the results in the first place. – Konrad Rudolph Sep 12 '16 at 17:23

0 Answers0