Question

1. Please use R. (1). Please use R. Please create a function which can operate t hypothesis testing with one population (two-tailed test). After entering vector data, significant level, and degree of freedom, output the word reject HO if the testing result rejects the null hypothesis. Output the word do not reject HO if the result does not reject the null hypothesis. Hint: use length to determine the degree of freedom of the t-distribution. (2). A factory claims its products weigh 60 gram in average. Now we take 6 products randomly and test them. The result of their weights are 57,63,68,45,71,70 gram. Suppose the weights of the products follow normal distribution. Please use the function you created in question (1) to test whether the claim of this factory is true. (a-0.05)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:-

2)

State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.

Null hypothesis: u = 60
Alternative hypothesis: u eq 60

Note that these hypotheses constitute a two-tailed test.

Formulate an analysis plan. For this analysis, the significance level is 0.05. The test method is a one-sample t-test.

Analyze sample data. Using sample data, we compute the standard error (SE), degrees of freedom (DF), and the t statistic test statistic (t).

Weight Sum Mean S.D Count S.E 374 62.3333333333333 9.9532239333126 4.06338665537887

SE = s / sqrt(n)

S.E = 4.0634

DF = n - 1

D.F = 5
t = (x - u) / SE

t = - 0.574

where s is the standard deviation of the sample, x is the sample mean, u is the hypothesized population mean, and n is the sample size.

Since we have a two-tailed test, the P-value is the probability that the t statistic having 5 degrees of freedom is less than -0.574 or greater than 0.574.

Thus, the P-value = 0.591.

Interpret results. Since the P-value (0.591) is greater than the significance level (0.05), we cannot reject the null hypothesis.

From the above test we do not have sufficient evidence in the favor of the claim that its products weight 60 gram in average.

Add a comment
Know the answer?
Add Answer to:
1. Please use R. (1). Please use R. Please create a function which can operate t...
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