Mathematics and Statistics Lab
MAT 104
Student Name: Mohit
Padmanabha Amin
Registration No. 240108024
1
Scenario: Study Hours and Exam Performance Analysis
You are analyzing a dataset to understand how the amount of time students dedicates to studying affects
their performance on exams. This dataset tracks study hours (X) and exam scores (Y) for a sample of 10
students.
Dataset:
Hours of Study (X): [8, 12, 15, 20, 25, 28, 32, 35, 40, 45]
Exam Scores (Y): [60, 70, 75, 82, 88, 92, 95, 98, 105, 110]
Question:
1. Regression Analysis:
ulate the regression coefficient and derive the equations for regression lines Y on X. Document each
calculation step in your report.
2. Excel: Use Excel to calculate the regression line equation Y =a+bX
3. Visualization:
te a line plot visualizing the relationship between study hours and exam scores. Add observations based on
the plot, focusing on the trend indicated by the regression lines and the
significance of the regression coefficient.
Solution
2
The regression line equation for the dataset is:
Y = 54.31 + 1.28X
Key Observations:
1. Slope (1.28): For every additional hour of study, the exam score increases by approximately 1.28
points.
2. Intercept (54.31): Even without any study hours, the predicted baseline exam score is 54.31
(though this may not have practical significance in this context).
Visualization:
The scatter plot and regression line indicate a strong positive relationship between study hours and exam
scores. The red line clearly shows the trend, demonstrating that increased study hours lead to higher exam
performance.
3
Scenario: Sleep and Productivity Analysis
You are investigating the impact of sleep on productivity levels. This dataset captures the number of hours
slept (X) and corresponding productivity levels (Y) for a group of 10 participants.
Dataset:
Hours of Sleep (X): [7, 9, 8, 6, 5, 7, 8, 6, 5, 7]
Productivity Levels (Y): [65, 72, 70, 58, 50, 68, 71, 60, 52, 69]
Tasks:
4. Correlation Analysis:
ulate the correlation coefficient to quantify the relationship between hours of sleep and productivity levels.
Include step-by-step calculations in the report.
5. Excel Analysis:
Excel to calculate correlation coefficient. Create a scatter plot in Excel to visually represent the relationship
between sleep hours and productivity levels.
Solution
Dataset:
Hours of Sleep (XXX): [7, 9, 8, 6, 5, 7, 8, 6, 5,
Productivity Levels (YYY): [65, 72, 70, 58, 50, 68, 71, 60, 52, 69]
4
L
65 HOURS OF SLEEP
72
70 85
58
75
50 f(x) = 5.76923076923077 x + 24.2692307692308
71 72
R² = 0.894454382826476 69 70
68 68
65 65
71 60
58
60 55
52
52 50
45
69
35
0 2 4 6 8 10
PRODUCTIVITY LEVELS
DOUBLE CLICK TO OPEN FILE
5
der the following data points of Marks obtained of 10 students of BSC ISM class
Data Points
12
18
25
30
35
35
45
50
60
70
Tasks:
6. Find the Mean, Mode, Median marks, Variance, and standard deviation of marks using Execl?
7. Find the first second and third quartile of the given marks using Excel?
8. Find the Interquartile range (IQR) using Excel?
6
38
35
35
302.8
40115
26.25
35
48.75
22.5
DOUBLE CLICK TO OPEN FILE
following table represents the number of students who scored within specific marks intervals in an exam:
7
Class Frequency
Interval
0-10 5
10-20 8
20-30 10
30-40 6
40-50 3
50-60 4
60-70 7
70-80 5
80-90 2
9. Calculate Mean using Excel for the given frequency distribution?
10. Calculate Mode using Excel for the given frequency distribution?
11. Calculate Median using Excel for the given frequency distribution?
12. Calculate Q1, Q2, Q3, and IQR using Excel for the given frequency distribution?
1. Calculate Mean (Task 9)
The Mean for a grouped frequency distribution can be calculated by using the formula:
Mean=∑(f×x)N\text{Mean} = \frac{\sum (f \times x)}{N}Mean=N∑(f×x)
Where:
fff is the frequency of each class interval.
xxx is the midpoint of each class interval.
NNN is the total number of students (sum of frequencies).
Steps to Calculate in Excel:
1. Find the Midpoint: For each class interval, find the midpoint (xxx) using the formula:
ound+Upper Bound2x = \frac{\text{Lower Bound} + \text{Upper Bound}}
{2}x=2Lower Bound+Upper Bound
8
2. Calculate Mode (Task 10)
The Mode is the value that appears most frequently in the data. For grouped data, we can calculate the
mode using the Mode Formula:
Mode=L+((f1−f0)(2f1−f0−f2))×h\text{Mode} = L + \left( \frac{(f_1 - f_0)}{(2f_1 - f_0 - f_2)} \right) \
times hMode=L+((2f1−f0−f2)(f1−f0))×h
Where:
LLL is the lower boundary of the modal class.
f1f_1f1 is the frequency of the modal class.
f0f_0f0 is the frequency of the class before the modal class.
f2f_2f2 is the frequency of the class after the modal class.
hhh is the class width.
9
Steps:
1. Identify the Modal Class: The modal class is the class interval with the highest frequency. In this
case, the highest frequency is 10 in the class interval 20-30.
Mode formula in Excel:
scss
Copy code
=20 + ((10 - 8) / (2*10 - 8 - 6)) * 10
Q1, Q2 (Median), Q3, and IQR (Interquartile Range) can be calculated as follows:
Steps:
1. Q1 (1st Quartile):
The first quartile is the value at the N4\frac{N}{4}4N-th position. In this case, 504=12.5\frac{50}
{4} = 12.5450=12.5. The class containing the 12.5th position will be the Q1 class.
2. Q2 (Median):
As calculated earlier, Q2Q2Q2 is the median of the entire data set.
3. Q3 (3rd Quartile):
The third quartile is the value at the 3N4\frac{3N}{4}43N-th position. In this case, 3×504=37.5\
frac{3 \times 50}{4} = 37.543×50=37.5. The class containing the 37.5th position will be the Q3
class.
4. IQR (Interquartile Range):
1\text{IQR} = Q3 - Q1IQR=Q3−Q1
10
Scenario: The following table shows the relationship between two variables, X and Y:
X Y
10 15
20 30
30 25
40 50
50 45
13. Calculate the correlation coefficient to determine the strength and direction of the relationship
between X and Y using excel.
14. Perform linear regression using excel to find the slope of the regression line and the intercept of
the regression line. Predict the value of Y when X=60.
15. Create a scatter plot of X and Y.
11
X Y 0.878114
10 15 0.8
20 30 9
30 25 57
40 50
50 45
CC
SLOP (M)
INTC (B)
P. X=60
DOUBLE CLICK TO OPEN FILE
12