Correlation analysis
📖 Scenario: You are a data analyst working with a small dataset of students' study hours and their exam scores. You want to find out if there is a relationship between how much students study and how well they perform on the exam.
🎯 Goal: Build a simple R program that calculates the correlation between study hours and exam scores using the Pearson method.
📋 What You'll Learn
Create a data frame with exact columns and values
Create a variable for the correlation method
Calculate the correlation using the cor() function with the method variable
Print the correlation result
💡 Why This Matters
🌍 Real World
Correlation analysis helps understand relationships between variables, like study time and exam scores, which is useful in education, business, and science.
💼 Career
Data analysts and scientists use correlation to find patterns and insights in data that guide decisions and predictions.
Progress0 / 4 steps