Skip to content
Prev 349784 / 398513 Next

Simulate values

Thanks for your final paragraph, we sometimes see people who want us
to do their homework for them and that does not go over well, but I
think you situation is one where many would be happy to help.  So here
are some hints to help:

The rnorm command expects the standard deviation, not the variance, so
to generate normals with variance equal to 25 you need to specify the
square root (5) as the 3rd argument.

The rep command will just repeat the 40 random number 500 times, not
generate new ones, so you will have the exact same sample (and all in
one long vector).  There are a few different ways to do this, but for
easiest understanding I would suggest using the replicate function,
this function will run a set of code the requested number of times, so
think about how you would generate your data and compute the test
statistic from the generated data, then pass that code to the
replicate function (if it is more than 1 line then use curly brackets
({}) to group the lines of code) to generate your 500 test statistics.
On Mon, Apr 6, 2015 at 4:52 PM, Osiris10101 <osiris94 at gmx.ch> wrote: