Advertisement
897bhgy

Untitled

Jul 13th, 2023
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 1.16 KB | Source Code | 0 0
  1. set.seed(123)
  2.  
  3. # Simulating scores using rnorm() function
  4. classA_scores <- rnorm(25, mean = 75, sd = 10)
  5. classB_scores <- rnorm(25, mean = 80, sd = 15)
  6.  
  7. # Null Hypothesis (H0): The mean mathematics exam score of students from class A is equal to the mean mathematics exam score of students from class B. In other words, there's no difference in the average performance of the two classes on the mathematics exam. Mathematically, we can denote it as (μ1 = μ2), where μ1 represents the mean score for class A and μ2 represents the mean score for class B.
  8.  
  9. # Alternative Hypothesis (H1): The mean mathematics exam score of students from class A is not equal to the mean mathematics exam score of students from class B. In other words, there is a significant difference in the average performance of the two classes on the mathematics exam. Mathematically, we can denote it as (μ1 ≠ μ2), where μ1 represents the mean score for class A and μ2 represents the mean score for class B.
  10.  
  11. # using t-test for hypothesis testing
  12. result <- t.test(classA_scores, classB_scores)
  13.  
  14. # using the print fumction to display information stored in the "result" variable
  15. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement