I am looking to create 400 datasets of size 180 numbers with the same mean but a different standard deviation. Is there a way to do this other than trial and error? Possibly some way to automate this process?
Thanks
I am looking to create 400 datasets of size 180 numbers with the same mean but a different standard deviation. Is there a way to do this other than trial and error? Possibly some way to automate this process?
Thanks
On
If you know Java, you can use Random.nextGaussian() to get a dataset with mean 0 and standard deviation $\sqrt{N}$. Multiplying each number in the dataset by the ratio of this to the desired standard deviation will get you to the standard deviation you want, and then (note the order) adding the desired mean to each will then get you the mean you want.
What have you tried?
Notice that if $M$ is the targt mean, then for each $x\in \mathbb{R}$ a pair of data points $(M+x, M-x)$ have mean $M$ and contribute $2x^2$ to the variance. Can you think of how to use this observation to craft however many datasets with mean $M$ and distinct standard deviations you wish?