Confidence Intervals in R
📖 Scenario: You are a data analyst working with a small dataset of exam scores. You want to understand the range in which the true average score likely falls by calculating a confidence interval.
🎯 Goal: Build an R script that calculates a 95% confidence interval for the mean of a given numeric dataset.
📋 What You'll Learn
Create a numeric vector called
scores with the exact values: 78, 85, 92, 88, 76, 95, 89Create a variable called
confidence_level and set it to 0.95Calculate the 95% confidence interval for the mean of
scores using the t.test() function and store the result in conf_intervalPrint the confidence interval stored in
conf_interval💡 Why This Matters
🌍 Real World
Confidence intervals help us understand the range where the true average of a population likely lies based on sample data.
💼 Career
Data analysts and scientists use confidence intervals to make informed decisions and report uncertainty in their findings.
Progress0 / 4 steps