lundi 17 juin 2019

Generate samples from data following normal distribution but with new mean

I have a vector of numbers that is

set.seed(1)
x <- rnorm(8334, 1.456977, 0.3552899)
mean(x)
[1] 1.454307

Essentially, I want to randomly sample 2000 numbers from x such that mean of this sample is lower.

The key is I don't want to generate new random numbers but only sample from x, without replacement, such that I get a subset with a different mean.

Can anyone help me?

Thanks!




Aucun commentaire:

Enregistrer un commentaire