ass_4_solution

.pdf

School

McMaster University *

*We aren’t endorsed by this school

Course

2B03

Subject

Statistics

Date

Jan 9, 2024

Type

pdf

Pages

10

Uploaded by DoctorFlamingoPerson503

Report
2B03 Assignment 4 Statistical Inference (Chapters 7, 8, & 9) Angelo Farruggia 400368065 2023-11-16 Instructions: You are to use Quarto Markdown for generating your assignment output file. You begin with the Quarto Markdown script downloaded from A2L, and need to pay attention to information provided via introductory material posted to A2L on working with R and Quarto Markdown. Having added your answers to the Quarto Markdown script, you then are to generate your output file using the “Render” button in the RStudio IDE and, when complete, upload both your Quarto Markdown file and your PDF file to the appropriate folder on A2L. 1. Define the following terms in a sentence (or short paragraph) and state a formula if appropriate (this question is worth 5 marks). a. Type II Error: In statistical hypothesis testing, a Type II error, also known as a false negative, is the error that occurs when one fails to reject a null hypothesis that is actually false. b. Power of a Test: The power of a statistical test is the probability that the test will correctly reject a null hypothesis that is actually false. The power of a test is inversely related to the probability of making a Type II error: power = 𝑃( reject 𝐻 0 |𝐻 1 is true ) = 1 − 𝛽 , where 𝛽 is the probability of a Type II error. c. Goodness of Fit Test: A goodness-of-fit test is a statistical test used to determine whether a set of observed values match those expected under the applicable model. It is commonly used when analyzing categorical data to determine if the observed data follows a specified probability distribution. d. 𝑃 -value: In statistical hypothesis testing, a 𝑝 -value is the probability of obtaining results as or more extreme than the ones observed if the null hypothesis is actually true. A small 𝑝 -value (typically below a predetermined significance level 𝛼 ) suggests that the observed data is unlikely to have occurred by random chance alone, leading DESKTOP-UESQ5Q8, x86-64, Vistauser 1
to the rejection of the null hypothesis. A large 𝑝 -value implies that the observed data is consistent with the null hypothesis. e. Simple Regression Analysis: Simple Regression Analysis is a statistical method used to explore and quantify the relationship between a single independent variable ( ? ) and a single dependent variable ( ? ) based on observations that have been carried out in the past. The simple linear regression model can be expressed by the equation ? = 𝛽 0 + 𝛽 1 ? + 𝜖 where ? is the dependent variable, ? is the independent variable, and 𝜖 is the error term representing unobserved factors affecting ? . The regression analysis aims to estimate the values of the coeffcients 𝛽 0 and 𝛽 1 based on the given data. 2. A coin operated coffee machine is set to pour 8 oz per cup. A random sample of the weights of a number of cups is as follows: 8.40, 8.25, 8.05, 7.84, 7.36, 8.54, 7.56, 7.56, 8.02, 7.39, 8.34, 8.56. Test the hypothesis that the machine is delivering at the level set by the manufacturer. Use a 0.01 level of significance (this question is worth 2 marks). Let 𝜇 be the population mean weight (in oz) of coffee per cup. 𝐻 0 ∶ 𝜇 = 8 𝐻 1 ∶ 𝜇 ≠ 8 coffee <- c ( 8.40 , 8.25 , 8.05 , 7.84 , 7.36 , 8.54 , 7.56 , 7.56 , 8.02 , 7.39 , 8.34 , 8.56 ) qqnorm (coffee) qqline (coffee) 2
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 7.4 7.8 8.2 8.6 Normal Q-Q Plot Theoretical Quantiles Sample Quantiles The points in the Normal Q-Q plot approximately follow the straight line, indicating that the data is approximately normally distributed and thus the one-sample t-test is appropriate. t.test (coffee, mu = 8 , conf.level = 0.99 ) One Sample t-test data: coffee t = -0.085097, df = 11, p-value = 0.9337 alternative hypothesis: true mean is not equal to 8 99 percent confidence interval: 7.593780 8.384554 sample estimates: mean of x 7.989167 Using the one-sample t-test, we cannot reject the null hypothesis at 1% level of significance, ?(11) = −0.085 , 𝑝 = .934 . The amount of coffee that the machine is delivering is not statistically significantly different from the level set by the manufacturer of 8 oz per cup. 3
3. Two different brands of milk are randomly sampled, and the fat content in each bottle of milk is determined. Twenty-six bottles of Brand A milk yielded an average fat content of ̄ ? 1 = 25 grams with ? 2 1 = 4 , and thirty one bottles of Brand B yielded an average fat content of ̄ ? 2 = 25.8 grams with ? 2 2 = 7 (this question is worth 3 marks). Test the hypothesis that both brands have identical average fat content at the 5% level of significance. Let 𝜇 1 be the population mean fat content of Brand A milk and let 𝜇 2 be the population mean fat content of Brand B milk. 𝐻 0 ∶ 𝜇 1 = 𝜇 2 𝐻 1 ∶ 𝜇 1 ≠ 𝜇 2 ̄ ? 1 = 25 , ? 2 1 = 4 , 𝑛 1 = 26 ̄ ? 2 = 25.8 , ? 2 2 = 7 , 𝑛 2 = 31 ? 2 𝑝 = (𝑛 1 −1)𝑠 2 1 +(𝑛 2 −1)𝑠 2 2 𝑛 1 +𝑛 2 −2 = (26−1)×4+(31−1)×7 26+31−2 = 25×4+30×7 26+31−2 = 310 55 ≈ 5.64 ? 𝑝 = √ ? 2 𝑝 = 5.64 ≈ 2.37 ? = ̄ 𝑋 1 ̄ 𝑋 2 𝑠 𝑝 1/𝑛 1 +1/𝑛 2 = 25−25.8 2.37×√ 1/26+1/31 ≈ −1.27 ?? = 𝑛 1 + 𝑛 2 − 2 = 26 + 31 − 2 = 55 # p-value pt ( - 1.27 , df = 55 ) * 2 [1] 0.2094315 Using the two-sample t-test, we cannot reject the null hypothesis at 5% level of significance, ?(55) = −1.27 , 𝑝 = .209 . The fat content does not statistically significantly differ between the two brands of milk. 4. To compare two programs for training industrial workers to perform a skilled job, 20 workers are included in an experiment. Of these, 10 are selected at random and trained by method 1; the remaining 10 are trained by method 2. After completion of training, all the workers are subjected to a time-and-motion test that records the speed of performance of a skilled job. The following time, as measured in minutes, is obtained. Method Method 1 15 20 11 23 16 21 18 16 27 24 Method 2 23 31 13 19 23 17 28 26 25 28 4
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help