Question
the codes should be done in matlab and please answer all questions.
Part B (Based off week 11 workshop content) An engineering ccmpony bas cedered steel to be used Soer a rail eustraction proje
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. To find the sample mean, simply take the average of all the data given, this means that you should add them all up and divide by 8. So the mean is given by:

m = (197 + 203 + 194 + 196 + 196 + 197 + 198 + 206)/8 = 198.375

To find the variance simply take the differences of each data point from the mean, square them and divide by the number of data points we have. So the variance is given by:

s = [(197 - 198.375)2 + (203 - 198.375)2 + (194 - 198.375)2 + (196 - 198.375)2 + (196 - 198.375)2 + (197 - 198.375)2 + (198 - 198.375)2 + (206 - 198.375)2]/8 = (1.8906 + 21.3906 + 19.1406 + 5.6406 + 5.6406 + 1.8906 + 0.1406 + 58.1406)/8 = 14.2343

To do this in matlab simply create a list as follows:

>> sample = [197, 203, 194, 196, 196, 197, 198, 206]

And then use mean(sample) and var(sample) respectively

2. The test goes as follows:

Null hypothesis: μ 200 vs Alternative hypothesis: μメ200

We need to perform a t test to prove or disprove the Null hypothesis. So we must find the standard error given by:

SE = s/sqrt(n) = 14.2343/sqrt(8) = 5.0325

The t-statistic is then given by

tc = (m - μ) / SE = (198.375 - 200)/5.0325 = -0.3229​​​​​​​

The degrees of freedom of this statistic are given by n-1 = 7 using a t table we see that the t-statistic for two tailed hypotheses with 95% confidence and 7 degrees of freedom is 2.365. This means that our calculated tcshould be greater than 2.365 or less than -2.365 to reject the null hypothesis, since this is not the case we can conclude that with 95% confidence the mean is 200.

3. The confidence interval is simply given by the formula:

772土2 0,025 S E

Where z0.025means the value on the z table where we find P(z > Z) = 0.025. So the confidence interval is given by

198.375 ± 1.96(5.0325)

Clearly 200 is included in this interval so it supports the results of the previous question.

4. To do this question, using the list we defined earlier, run the command:

>> ttest(sample, 200)

This tests whether the mean of the sample data is 200. It returns 0 if we keep the null hypothesis (mean is 200) and 1 if we reject the null hypothesis (mean is not 200).

5. Recall that the confidence interval is given by 772土2 0,025 S E . And SE depends on the number of observations. If we were to double the sample size and keep the same sample mean and sample variance we would be left with

SE = 14.2343/sqrt(16) = 3.5585

And a 95% confidence interval of

198.375 ± 1.96(3.5585)

Meaning that the interval got smaller.

Add a comment
Know the answer?
Add Answer to:
the codes should be done in matlab and please answer all questions. Part B (Based off week 11 workshop content) An e...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT