Posts

Showing posts from March, 2026
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...