I need to generate a random sample of size 200 (n=200) from a normal distribution with variance 1 and true mu (average) I specify; then, I test the draw against a hypothesis: mu <= 1. I need to do this for each of 400 potential true thetas, and for each true theta I need to replicate this 200 times.
I already did this for n=1, but I realize my approach is not replicable. For each 400 thetas, I ran the following:
sample_r200n1_t2=normal(loc=-0.99, scale=1, size=200)
sample_r200n1_t3=normal(loc=-0.98, scale=1, size=200)
sample_r200n1_t4=normal(loc=-0.97, scale=1, size=200)
sample_r200n1_t5=normal(loc=-0.96, scale=1, size=200)
... on and on to loc = 3
Then, I tested each element in the generated array separately. However, that approach would require me to generate tens of thousands of samples, I generate the mean associated with each, then test that mean against my criteria. This would have to be done 80,000 times (and, on top of this I need to do this for multiple different sizes n). Clearly - this is not the approach to take.
How can I achieve the results I am looking for? Is there a way, for example, to generate an array of sample means and put those means into an array, one per theta? Then I could test as before. Or, is there another way?