Question: Question 10 Write R code to generate a random sample of size 20 from a normal distribution with mean of 100 and standard deviation

Question 10 Write R code to generate a random sample of size 

Question 10 Write R code to generate a random sample of size 20 from a normal distribution with mean of 100 and standard deviation of 4. Next, generate a variable y = 2 + x + , where represents noise on the data which is normally distributed with a mean of zero and a standard deviation of 1. You have just generated 20 pairs of data, with each element in y associated with the corresponding element in by adding a number 2 with some uncertainty due to noise. Plot the points and y superimposed on the same graph and draw lines showing their means, ensuring that you get all datapoints on the graph. Use the two-sample t test in R to test if the means of X and Y are significantly different at 5% level of significance. Also, use the matched pairs t test for the same hypothesis test and comment on the difference in the conclusions from the two tests. Which of the two tests is appropriate for this data? Explain. [4 marks]

Step by Step Solution

3.39 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete this task in R first we will generate ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!