0
$\begingroup$

I understand from here: Random number-Set.seed(N) in R

that "The seed number you choose is the starting point used in the generation of a sequence of random numbers..."

But, I'm not so sure if there's a meaning to the gaps between the seed integers when I'm trying (for example) to produce 3 different samples from the same data set. In other words, is there a difference in the "quality" of the first 3 samples (A group...) compared to the second 3 samples (B group...) in the following code:

A group: 

set.seed(1)
sample(1:10000, size=100)
set.seed(2)
sample(1:10000, size=100) 
set.seed(3)
sample(1:10000, size=100) 

B group: 

set.seed(195)
sample(1:10000, size=100)
set.seed(278)
sample(1:10000, size=100) 
set.seed(315)
sample(1:10000, size=100)

Thank you in advance!

$\endgroup$
0
$\begingroup$

TLDR; It doesn't matter.

Pseudo-random number generator is a deterministic function that takes as an input some seed (if you do not set it explicitly, it will take something by default, e.g. system time) and returns output (usually uniformly distributed on $(0,1)$) that is hardly distinguishable from truly random numbers. Of course PRNG's differ in their quality, so for example the default PRNG's in C++, Excel, JavaScript etc. should not be used in applications where it is important that your output is random enough (e.g. statistics, cryptography). On another hand, R by default uses a decent PRNG, but if you thought using it for cryptography, then you should consider other alternatives beforehand.

As about seeds, it doesn't matter. For any seed the values will be to the same extent close to random. The only thing to remember is that if you repeat seeds, then you get the same results, so the output stops being random and starts being deterministic.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.