Posts

Showing posts from September, 2024

Module # 5 assignment

Image
  Issaiah Jennings  Module # 5 assignment Question 1: The director of manufacturing at a cookies company needs to determine whether a new machine is able to produce a particular type of cookies according to the manufacturer's specifications, which indicate that cookies should have a mean of 70 and standard deviation of 3.5 pounds. A sample of 49 cookies reveals a sample mean breaking strength of 69.1 pounds. A. State the null and alternative hypothesis H₀: μ = 70, H₁: μ ≠ 70 B. Is there evidence that the machine is not meeting the manufacturer's specifications for average strength? Use a 0.05 level of significance  z=49​3.5​69.1−70​=0.5−0.9​=−1.8 Population mean (μ₀) = 70 Sample mean (x̄) = 69.1 Sample size (n) = 49 Standard deviation (σ) = 3.5 Significance level (α) = 0.05 > z <- -1.8 > p_value <- 2 * pnorm(-abs(z))  > p_value [1] 0.07186064 The p-value (0.0719) is greater than the significance level (0.05), we fail to reject the null hypothesis. C. C...

Module # 4 Probability theory

Issaiah Jennings  Module # 4 Probability theory A. Based on Table 1 What is the probability of: B B1 A 10 20 A1 20 40 A1 . Event A A2 . Event B? A3.  Event A or B A4 . P(A or B) = P(A) + P(B) # Total observations in the table > total <- 10 + 20 + 20 + 40 >  > # A1. Probability of Event A > P_A <- (10 + 20) / total > cat("P(A) =", P_A, "\n") P(A) = 0.3333333  >  > # A2. Probability of Event B > P_B <- (10 + 20) / total > cat("P(B) =", P_B, "\n") P(B) = 0.3333333  >  > # A3. Probability of A or B > P_A_or_B <- (10 + 20 + 20) / total > cat("P(A or B) =", P_A_or_B, "\n") P(A or B) = 0.5555556  >  > # A4. Verifying P(A or B) = P(A) + P(B) - P(A and B) > P_A_and_B <- 10 / total  # Intersection of A and B > P_A_or_B_formula <- P_A + P_B - P_A_and_B > cat("P(A or B) using formula =", P_A_or_B_formula, "\n") P(A or B) using formula = 0.5555556  ...

Module # 3 assignment

  Module # 3 assignment # Data sets set1 <- c(10, 2, 3, 2, 4, 2, 5) set2 <- c(20, 12, 13, 12, 14, 12, 15) # Central Tendency mean_set1 <- mean(set1) median_set1 <- median(set1) mode_set1 <- as.numeric(names(sort(-table(set1)))[1])  # Mode mean_set2 <- mean(set2) median_set2 <- median(set2) mode_set2 <- as.numeric(names(sort(-table(set2)))[1])  # Mode # Variation range_set1 <- range(set1) iqr_set1 <- IQR(set1) variance_set1 <- var(set1) std_dev_set1 <- sd(set1) range_set2 <- range(set2) iqr_set2 <- IQR(set2) variance_set2 <- var(set2) std_dev_set2 <- sd(set2) # Output cat("Set 1\n") cat("Mean:", mean_set1, "\n") cat("Median:", median_set1, "\n") cat("Mode:", mode_set1, "\n") cat("Range:", diff(range_set1), "\n") cat("IQR:", iqr_set1, "\n") cat("Variance:", variance_set1, "\n") cat("Standard Deviation:"...

Module # 2 assignment

  Module # 2 assignment Download Download the outline instructions on how to import  download data to RStudio Review Chapter # 1 - Dalgaard's  Introductory Statistics with R  and Matloff -  The Art of R programming   Chapter 1-3  Evaluate the following function call  myMean . The data for this function called  assignment . The assignment contains the following data:   6 ,  18 ,  14 ,  22 ,  27 ,  17 ,  19 ,  22 ,  20 ,  22 >   assignment2<- c(6,18,14,22,27,17,22,20,22) >  myMean <- function(assignment2) {return(sum(assignment2)/length(assignment2))} # Assign data to a vector assignment2 <- c(6, 18, 14, 22, 27, 17, 19, 22, 20, 22) # Calculate the mean myMean <- function(assignment2) {   return(sum(assignment2) / length(assignment2)) } # Call the function and store the result result <- myMean(assignment2) # Print the result print(result) [1] 18.7 assignme...