Sei sulla pagina 1di 9

30-Nov-18

ME - 5101
Engineering Analysis &
Statistics
Lect. # 5
Determination of Correlation
Co-efficient
Dr. Nazeer Ahmad Anjum
Mechanical Engineering Program
Engineering University Taxila

Plotting Data and Types of Plots 2


Perfect linear correlation:
A perfect positive correlation is given the value of 1. A
perfect negative correlation is given the value of -1.

30-Nov-18

1
30-Nov-18

Plotting Data and Types of Plots 3


Strong Linear Correlation:
The closer the number is to 1 or -1, the stronger the correlation, or
the stronger the relationship between the variables. A positive
correlation means that if one variable gets bigger, the other
variable tends to get bigger.

30-Nov-18

Plotting Data and Types of Plots 4


Weak Linear Correlation:
A weak correlation means that as one variable increases
or decreases, there is a lower likelihood of there being a
relationship with the second variable The closer the number
is to 0, the weaker the correlation.

30-Nov-18

2
30-Nov-18

Plotting Data and Types of Plots 5


Weak Linear Correlation:

30-Nov-18

CORRELATION COEFFICIENT: A quantitative measure of


the strength of the linear relationship between two random
variables x and y
S xy
rxy 
 yi xi x 
n
SxSy
rxy i1
Sx and S y are the sample
n 2

i1 yi  y 2n
 xix  Standard Deviation, and Sxy
 i1  is the sample co-variation.
n xy   x)( y
rxy 
   
n  x 2  x 2 n  y 2  y 2
The population correlation coefficient uses x and y
as the population standard deviations, and xy as the
population co-variance. xy
r xy 
 x y

3
30-Nov-18

If the two variables are perfectly linearly related with a


positive correlation/slope, then rxy = 1.
If they are perfectly linearly related with a negative
correlation/slope, then rxy = −1.
If no linear relationship between the two variables exists,
then rxy = 0.
The simple correlation coefficient is also sometimes called
the Pearson correlation coefficient after Karl Pearson,

Correlations below | 0.5 | are generally considered weak


and correlations above | 0.8 | are generally considered
strong.

Find Correlation Coefficient Between Quality & pH


Values

4
30-Nov-18

Example 2: Determination of Correlation Coefficient, r


The tensile strength and elongation in mm is given in the table,
calculate correlation coefficient.
Load El xi- 𝒙 yi- 𝒚 y(xi-𝒙) 𝒙𝒊 − 𝒙 𝒚𝒊 − 𝒚
Load (kN) Elongation (kN), x (mm), y
49 22
49 22
66 26
66 26
67 21
67 21
78 25
78 25
89 25
89 25
96 29
96 29
100 27
100 27
107 32
107 32
110 29
110 29

 762 236 20474 68016 6286


Mean 84.67 26.22

r = 0.843, a high positive correlation can be seen.

Example 3:The table below shows the number of absences


‘x’, in a Calculus course and the final exam grade ‘y’, for 7
students. Find the correlation coefficient and interpret your
result.
X (ABST) Y (Grade)
1 95
0 90 n= 7
2 90 r = -0.93
6 55
4 70
3 80
3 85

Interpretation of Result: There is a strong negative


correlation between the number of absences and the final
exam grade, since r is very close to -1. Thus, as the
number of absences increases, the final exam grade tends
to decrease.

5
30-Nov-18

Example 4: Find the Correlation Co-efficient for the data


given below n= 5
X Values Y Values
40 3 r = 0.16703
42 6
43 9
45 5
44 3
46 7

Example 5: Calculate and analyze the correlation coefficient


between the number of study hours and the number of
sleeping hours of different students
Number of Study Hours 2 4 6 8 10
Number of Sleeping Hours 10 9 8 7 6
Answer is -1. There is a perfect negative correlation
between the number of study hours and the numberof
sleeping hours.

Example 6:The time ‘x’ in years that an employee spent at a


company and the employee's hourly pay ‘y’ for 5 employees
are listed in the table below. Calculate and interpret the
correlation coefficient r. Include a plot of the data in your
discussion.
X (years) Y (pay)
5 25
3 20
4 21
10 35
15 38

n= 5
r = 0.97
Interpretation of Result: There is a strong positive
correlation between the number of years and employee
has worked and the employee's salary, since r is very close
to 1.

6
30-Nov-18

Plotting Data and Types of Plots 13


Map Graph Cosmograph
Map chart Advantages Disadvantages
A map chart • Good visual • Needs limited
displays data by appeal categories
shading sections • Overall trends • No exact
of a map, and show well. numerical
must include a values
key. A total data • Color key can
number should be skew visual
included. interpretation.

30-Nov-18

Plotting Data and Types of Plots 14


Map Graph Cosmograph

30-Nov-18

7
30-Nov-18

Data and Types of Plots 15


Histograms

In a histogram, data are grouped into intervals of


EQUAL width. The number of data values in
each interval is the frequency of the interval. To
draw, begin by using a frequency chart (tally
chart) and making a frequency distribution
(intervals). Histogram typically contain 5-10
intervals.

30-Nov-18

Data and Types of Plots 16


Histograms
Histogram Advantages Disadvantages
A histogram is a type • Visually strong • Cannot read exact
of bar graph that • Can compare to values from
displays continuous normal curve histogram
data in ordered because data is
• Usually vertical
columns called grouped into
axis is a frequency
intervals. Categories categories.
count of items
are of continuous
falling into each • More difficult to
measure such as compare two data
category.
time, Distance, sets.
temperature, etc.
• Use only with
Bars have the same
continuous data
width and are drawn
(intervals).
next to each other
with no gaps.
30-Nov -18

8
30-Nov-18

Data and Types of Plots 17


Histograms 2009-2010 Mean SAT Math Scores

30-Nov-18

Data and Types of Plots 18


Histograms

30-Nov-18

Potrebbero piacerti anche