Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set.seed(123)
- # Simulating scores using rnorm() function
- classA_scores <- rnorm(25, mean = 75, sd = 10)
- classB_scores <- rnorm(25, mean = 80, sd = 15)
- # 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.
- # 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.
- # using t-test for hypothesis testing
- result <- t.test(classA_scores, classB_scores)
- # using the print fumction to display information stored in the "result" variable
- print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement