Hi guys, I'm just starting and I need help with something. It's a pretty basic thing, but I don't know how to solve this.
My issue is that I keep getting the same results with the sample() function, despite the fact that I've set.seed(1), do you know how can provide same basic assistance?
This is just an example of the problem:
> population <- unlist(femaleControlsPopulation)
> control <- sample(population, 12)
> treatment <- sample (population,12)
> mean(control)
[1] 22.6925
> mean(control)
[1] 22.6925
> mean(treatment)
[1] 26.14583
> mean(treatment)
[1] 26.14583
> mean(treatment)-mean(control)
[1] 3.453333
> mean(treatment)-mean(control)
[1] 3.453333
or
> y<-mean(sample(1000,15,replace = TRUE))
> y
[1] 622.4
> y
[1] 622.4
> y
[1] 622.4
Sorry for asking such a basic question.
Andres