Question

(4)(b) Using *set.seed(124)* and the Nile data, generate 1000 random samples of size n = 16,...

(4)(b) Using *set.seed(124)* and the Nile data, generate 1000 random samples of size n = 16, with replacement. For each sample drawn, calculate and store the sample mean. This can be done with a for-loop and use of the *sample()* function. Label the resulting 1000 mean values as "sample1". **Repeat these steps using *set.seed(127)* - a different "seed" - and samples of size n = 64.** Label these 1000 mean values as "sample2". Compute and present the means, sample standard deviations and sample variances for "sample1" and "sample2" in a table with the first row for "sample1", the second row for "sample2" and the columns labeled for each statistic.

I have solved for the mean, standard deviation and variances for the two samples. I need help to compute and present them in a table.

set.seed(124)

sample1=numeric(1000)

for(i in 1:1000) {

sample1[i]=mean(sample(Nile,16,TRUE)) }

set.seed(127)

sample2=numeric(1000)

for(i in 1:1000) { sample2[i]=mean(sample(Nile,64,TRUE)) }

mean(sample1)

mean(sample2)

sd(sample1)

sd(sample2)

var(sample1)

var(sample2)

Homework Answers

Answer #1

PLEASE UPVOTE IF YOU LIKE MY ANSWER

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions