Posts

Image
  Module 10. Assignment: Question A:   A1:  In the report, please state the result of coefficients and significance to any variables you like both under ANOVA and multivariate analysis. Please provide a specific interpretation of R results.    In this analysis, I used pemax as the dependent variable for the multiple regression experiment. Results: Weight = (p = 0.03287) Bmp = (p = 0.02036) Fev1 = (p = 0.04695) Age = (p = 0.31389)   Age is the only variable that isn't significant. The p-values of weight, bmp, and fev1 are all significant. Weight: A one-unit increase in weight increases the predicted pemax by 2.6882 Bmp: A one-unit increase in bmp decreases pemax by 2.0657 units. Fev1: A one-unit increase in fev1 increases pemax by 1.0882 units.   ANOVA test results: Age = (p = 0.00035) Weight = (p = 0.2038) Bmp = (p = 0.050) Fev1 = (p = 0.0469) The weight variable in the regression model is significant unlike in the ANOVA. The age variable in the ANO...
Image
  Module 9. Assignment: R_Code: Question A: df <- data.frame( country = c("France", "Spain", "Germany", "Spain", "Germany", "France", "Spain", "France", "Germany", "France"),   age = c(44, 27, 30, 38, 40, 35, 52, 48, 45, 37),   salary = c(6000, 5000, 7000, 4000, 8000, 6000, 5000, 7000, 4000, 8000), purchased = c("No", "Yes", "No", "No", "Yes", "Yes", "No", "Yes", "No", "Yes") ) A1:  Generate a one-way table for "purchased" A2:  Generate a two-way table for "c ountry" and "purchased." Question B: data ( mtcars ) mtcars_df <- table ( mtcars $ gear , mtcars $ cyl , dnn = c ( "Gears" , "Cylinders")) B1:  Add the addmargins() function to report on the sum totals of the rows and columns of " mtcars_df" table B2:  A dd p...
Image
Module 8. Assignment: Question A: Results: After the ANOVA test was performed in R, we got these results:   Source: Group; Df: 2 Sum Sq: 82.11 Mean Sq: 41.06 F-value: 21.36 Pr(>F): 4.08e-05 Source: Residuals; Df: 15 Sum Sq: 28.83 Mean Sq: 1.92 Interpretation: We used a one-way ANOVA to test if stress levels affect the reaction scores after taking the drug. Therefore, our null hypothesis (H_O) is if the mean reaction score is the same for all three stress groups. Next, our alternative hypothesis (H_1) is if at least one group is different. After running the test, we gathered a p-value of 4.08e-05, which is significantly smaller than the significant level of 0.05. Therefore, we have no choice but to reject the null hypothesis. Meaning, that there is a notable difference between the stress groups and that stress levels play a large role on the reaction scores after taking the drug. Those under high stress tend to have higher scores, indicating that the drug's effect may vary depend...
Image
  Module 7. Assignment: Question A: A1:  Define the relationship model between the independent and the dependent variable. The simple linear regression model is:  Y = a +bX + e, where: y = dependent variable x = independent variable a = intercept (the value of y when x = 0) b = slope e = error  A2:  Calculate the coefficients. The calculated regression equation is: y = 19.2056 + 3.2691x, where: Intercept = 19.2056 Slope = 3.2691  Question B: B1:  Define the relationship model between the predictor and the response variable. Discharge = a + b(waiting) Discharge = response variable Waiting = predictor variable  B2:  Extract the parameters of the estimated regression equation with the coefficients function. My model is: discharge = -1.874 + 0.0756(waiting), where: Intercept = -1.874 waiting = 0.0756  B3:  Determine the fit of the eruption duration using the estimated regression equation. y = -1.874 + 0.0756(80) y = -1.874 + 6.0504 y...
Image
  Module 6. Assignment: Question A: A1.  Compute the mean of this population: A2.  Select a random sample of size 2 out of the five members:  I have selected (14,10) A3.  Compute the mean and standard deviation of your sample: Mean = (14+10)/2 = 12 SD = sqrt((((14-12)^2)+((10-12)^2))/(2-1)) = sqrt(8) = 2.83 A4.  Compare the Mean and Standard deviation of your sample to the entire population of this set (8,14, 16, 10, 11):   Comparison: The population mean is 11.8, whereas the sample mean is 12. Both values are close but differ due to sampling variability. The population standard deviation is about 2.86 whereas the sample standard deviation is 2.83. I believe the discrepancy is due to the sample having fewer observations and its SD using "n - 1", while population SD is only using "n".  Question B: B1. Does the sample proportion p have approximately a normal distribution? Explain : n = 100 p = 0.95 q = 1 - p = 0.05 np = 100(0.95) = 95 nq = 100(0.05...
Image
  Module 5. Assignment: Some things to note before starting this assignment: Question A: A1:  State the null and alternative hypothesis _______ Given that: H0 = 70 σ = 3.5 n = 49 x̄ = 69.1 H0  = 70 H1 =/ 70 A2:   Is there evidence that the machine is not meeting the manufacturer's specifications for average strength? Use a 0.05 level of significance _______  I believe there isn't evidence regarding the machine not meeting the manufacturer's requirements, we have the values to compute this. To test this, we need to use the formula first: z = ( x̄-H0)/(σ/(sqrt(n)))  -> (69.1-70)/(3.5/(sqrt(49))) = -1.8 Now, we need to use this formula: Two-tailed p-value = p = 2 * pnorm(z) A3:  Compute the p value and interpret its meaning _______     As we can see, our p-value is 0.071861 = 0.072. This means that p > alpha (0.072 > 0.05). Therefore, We fail to reject the null hypothesis, meaning there isn't enough evidence that the machin...
Image
  Module 4. Assignment: Question A:         A1: What is the probability of event A? P_Total = 10 + 20 + 20 + 40 = 90 P(A) = (10 + 20)/90 = 30/90 = 3/9 = 1/3 = 0.333333...  A2: What is the probability of event B? P(B) = (10   + 20)/90 = 30/90 = 3/9 = 1/3 = 0.333333... A3: What is the probability of event A or B? P(A   ∩     B) = 10/90 = 1/9 = 0.1111 P(A  ∪ B ) = P(A) + P(B) - P(A  ∩  B) = 1/3 + 1/3 - 1/9 = 5/9 = 0.5556 A4: What is the probability of   P(A or B) = P(A) + P(B)? P(A or B) = P(A   ∪ B) P(A   ∪ B) = P(A) + P(B) only if they're mutually exclusive. However, since they are not mutually exclusive, that means they overlap. Therefore, the probability of it happening is zero. Question B: What is the probability that it will rain on the day of Jane's wedding? P(rain) = 5/365 P(forecast rain | rain) = 0.9 P(forecast rain | no rain) = 0.1 P(rain |   forecast rain) = ((5/365)(0.9))/((5/365)(0/9)) + ((36...