Performing a t-test in R
📖 Scenario: You are a scientist studying the effect of a new fertilizer on plant growth. You have measured the heights of plants with and without the fertilizer. You want to check if the fertilizer makes a significant difference in plant height.
🎯 Goal: Learn how to perform a t-test in R to compare two groups of data and interpret the result.
📋 What You'll Learn
Create two numeric vectors with exact plant height values
Create a variable to hold the significance level
Use the
t.test() function to compare the two groupsPrint the p-value from the t-test result
💡 Why This Matters
🌍 Real World
Scientists and researchers use t-tests to check if two groups have different averages, like testing new medicines or fertilizers.
💼 Career
Data analysts and scientists often perform t-tests to make decisions based on data and prove if changes have real effects.
Progress0 / 4 steps