S-Plus Quiz

Instructions: Please copy and paste these questions into an e-mail addressed to fraley@uic.edu. As you complete each question, paste the answer into the e-mail. Feel free to use your notes, but please do not consult one another.

1. What command might you use to create a variable, z, that will be composed of scores randomly sampled from a normal distribution of population scores with a mean of 100 and a standard deviation of 15?

2. Create a variable called x1 that contains the following scores: 1, 2, 4, 6, 3, 6, 7, 4, 3. Please write a command that will give us the mean of these scores (and give me the answer). Also, write a command that will give us the standard deviation of these scores (and tell me the answer).

3. Create a loop in S-Plus that allows you draw many (i.e., 10,000) random samples of size 10 from a normal distribution in which the mean is 4 and the standard deviation is .5. Each time the program passes through the loop, it needs to (a) take a random sample of 10 cases from the population, (b) calculate the mean of the 10 scores, (c) 'save' the sample mean in a vector. After you've written the program and run it, tell me the average and standard deviation of these 10,000 sample means.