Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed 

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

Step: 1

To complete this task in R first we will generate ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Statistics And Data Analysis

Authors: Roxy Peck, Chris Olsen, Jay L. Devore

3rd Edition

0495118737, 9780495118732

More Books

Students also viewed these Finance questions