Presentation Chapter 6 MTH1022

Embed Size (px)

Citation preview

  • 7/28/2019 Presentation Chapter 6 MTH1022

    1/45

    TOPIC 6CORRELATION & REGRESSION

    Module Outcomes:

    [MO1] Identify basic mathematical concepts, skills and mathematical

    techniques for algebra, calculus and data handling.[MO2]Apply the mathematical calculations, formulas, statistical

    methods and calculus techniques for problem solving in industry.

    [MO3]Analyse calculus and statistical problems in industry.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    2/45

  • 7/28/2019 Presentation Chapter 6 MTH1022

    3/45

    INTRODUCTION

    Positive linear relationship:

    An increase in one variable cause another variable to

    increase

    Example: Sugar pr ice and Food pr ice

    Negative linear relationship:

    An increase in one variable cause another variable to

    decrease

    Example: Energy price and companies profits

  • 7/28/2019 Presentation Chapter 6 MTH1022

    4/45

    THESCATTERDIAGRAM

    Use to determine whether a relationship exist

    between two variables.

    The independent variable is normally labeled on the

    horizontal axis and dependent variable on the

    vertical axis.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    5/45

    Rectangular coordinate

    Two quantitative variables

    One variable is called independent (X) and

    the second is called dependent (Y)

    Points are not joined

    No frequency table

    Scatter diagram

    Y

    * *

    *

    X

  • 7/28/2019 Presentation Chapter 6 MTH1022

    6/45

    SCATTERDIAGRAMOFWEIGHTANDSYSTOLICBLOOD

    PRESSURE

    80

    100

    120

    140

    160

    180

    200

    220

    60 70 80 90 100 110 120

    wt (kg)

    SBP(mmHg)

    Wt.

    (kg)

    67 69 85 83 74 81 97 92 114 85

    SBP

    mHg)

    120 125 140 160 130 180 150 140 200 130

  • 7/28/2019 Presentation Chapter 6 MTH1022

    7/45

    80

    100

    120

    140

    160

    180

    200

    220

    60 70 80 90 100 110 120Wt (kg)

    SBP(mmHg)

    Scatter diagram of weight and systolic blood pressure

  • 7/28/2019 Presentation Chapter 6 MTH1022

    8/45

    No relationship between weight and pulse rate

  • 7/28/2019 Presentation Chapter 6 MTH1022

    9/45

    THE SCATTER PLOTS

    The pattern of data is indicative of the type of

    relationship between your two variables:

    positive relationship

    If x increase, y will increase as well. negative relationship

    If x increase, y will decrease and if x decrease, y will

    increase.

    no relationship

    If the slope is zero, so the two variable are not

    related.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    10/45

    POSITIVERELATIONSHIP

  • 7/28/2019 Presentation Chapter 6 MTH1022

    11/45

    0

    2

    4

    6

    8

    10

    12

    14

    16

    18

    0 10 20 30 40 50 60 70 80 90

    Age in Weeks

    HeightinCM

  • 7/28/2019 Presentation Chapter 6 MTH1022

    12/45

    NEGATIVERELATIONSHIP

    Reliability

    Age of Car

  • 7/28/2019 Presentation Chapter 6 MTH1022

    13/45

    NORELATION

  • 7/28/2019 Presentation Chapter 6 MTH1022

    14/45

  • 7/28/2019 Presentation Chapter 6 MTH1022

    15/45

    Ex: Draw a scatter diagram for the following data and state the type of

    relationship between the variables.

    P 3 4 6 8 11 17 18 22q 10 20 3 7 4 1 12 5

    0

    5

    10

    15

    20

    25

    0 5 10 15 20 25

    q

    q

    Based on the scatter diagram, it is determined that there is no relationship between

    the two variables.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    16/45

    WHATISCORRELATION???

    Correlation analysis is a statistical method used to

    measure the STRENGTH of the relationship

    between two variables which are independent

    variable (X) and dependent variable (Y).

  • 7/28/2019 Presentation Chapter 6 MTH1022

    17/45

  • 7/28/2019 Presentation Chapter 6 MTH1022

    18/45

    Pearsons correlation coefficient is used to measure

    the strength of the relationship between two variablesthat are quantitative in nature

    This method is not suitable for qualitative data,

    especially rank data

  • 7/28/2019 Presentation Chapter 6 MTH1022

    19/45

    SIMPLE CORRELATIONCOEFFICIENT () It is also called Pearson's correlation or product

    moment correlation coefficient.

    It measures the nature and strength between two

    variables of the quantitative type.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    20/45

    The sign ofrdenotes the nature of

    association

    while the value ofrdenotes the

    strength of association.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    21/45

    If the sign is +ve this means the relation isdirect (an increase in one variable is associated

    with an increase in the other variable and adecrease in one variable is associated with adecrease in the other variable).

    While if the sign is -ve this means an inverse orindirect relationship (which means an increasein one variable is associated with a decrease inthe other).

  • 7/28/2019 Presentation Chapter 6 MTH1022

    22/45

    The value of r ranges between ( -1) and ( +1)

    The value of r denotes the strength of theassociation as illustrated

    by the following diagram.

    -110

    -0.25-0.75 0.750.25

    strong strongintermediate intermediateweak weak

    no relation

    perfect

    correlation

    perfect

    correlation

    Directindirect

  • 7/28/2019 Presentation Chapter 6 MTH1022

    23/45

    Ifr= Zero this means no association orcorrelation between the two variables.

    If0 < r< 0.25 = weak correlation.

    If0.25 r< 0.75 = intermediate correlation.

    If0.75 r< 1 = strong correlation.

    Ifr= l = perfect correlation.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    24/45

    Example : The table below show the interest rates for car loans and the average

    number of customers who apply for the loans in a month from a finance company.

    Interest rate

    in %, x 6.0 6.2 6.5 6.8 7.0

    Number of

    applicants, y80 80 78 75 70

    x y xy6.0 80 36 6400 480

    6.2 80 38.44 6400 496

    6.5 78 42.25 6084 507

    6.8 75 46.24 5625 510

    7.0 70 49 4900 490

    = 3 2 . 5 = 3 8 3 =211.93 =29409 =2483

  • 7/28/2019 Presentation Chapter 6 MTH1022

    25/45

    EXAMPLE:

    Weight

    (Kg)

    Age

    (years)

    serial

    No

    1271

    862

    1283

    1054

    1165

    1396

    A sample of 6 children was selected, data about their

    age in years and weight in kilograms was recorded as

    shown in the following table . It is required to find the

    correlation between age and weight.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    26/45

    These 2 variables are of the quantitative type, one variable

    (Age) is called the independent and denoted as (X)

    variable and the other (weight) is called the dependent and

    denoted as (Y) variables to find the relation between ageand weight compute the simple correlation coefficient

    using the following formula:

  • 7/28/2019 Presentation Chapter 6 MTH1022

    27/45

    Y2X2xy

    Weight

    (Kg)

    (y)

    Age

    (years)

    (x)

    Serial

    n.

    14449841271

    643648862

    14464961283

    10025501054

    12136661165

    169811171396

    y2=

    742

    x2=

    291

    xy=

    461

    y=

    66

    x=

    41

    Total

  • 7/28/2019 Presentation Chapter 6 MTH1022

    28/45

    r = 0.759

    strong direct correlation

  • 7/28/2019 Presentation Chapter 6 MTH1022

    29/45

    EXAMPLE: RELATIONSHIPBETWEEN ANXIETYAND

    TEST SCORES

    Anxiety

    (X)

    Test score

    (Y)X2 Y2 XY

    10 2 100 4 20

    8 3 64 9 242 9 4 81 18

    1 7 1 49 7

    5 6 25 36 306 5 36 25 30

    X = 32 Y = 32 X2 = 230 Y2 = 204 XY=129

  • 7/28/2019 Presentation Chapter 6 MTH1022

    30/45

    CALCULATING CORRELATION COEFFICIENT

    94.0

    )200)(356(

    1024774

    32)204(632)230(6

    )32)(32()129)(6(22

    r

    r = - 0.94

    Indirect strong correlation

  • 7/28/2019 Presentation Chapter 6 MTH1022

    31/45

    =0.09

    Pearsons product moment correlation coefficient is -0.09. since this value isclose to -1.0, we conclude that there is a very strong negative linear

    relationship between variable x and y.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    32/45

  • 7/28/2019 Presentation Chapter 6 MTH1022

    33/45

    =0.953

    Pearsons product moment correlation coefficient is 0.953. since this value

    is close to 1.0, we conclude that there is a very strong positive linear

    relationship between variable x and y.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    34/45

    SPEARMANS RANK CORRELATION COEFFICIENT

    1. Spearmans rank correlation coefficient is a measure ofassociation between two variables that are at least of

    ordinal scale.

    2. Suitable for qualitative data and quantitative data but

    quantitative data must transformed into qualitative data.

    = 1 6

    ( 1)To compute Spearmans rank correlation:

    1. Make a list of the n subject ( or observation)

    2. Enter the rank of X and rank of Y variable.

    3. Find = .4. Find .

  • 7/28/2019 Presentation Chapter 6 MTH1022

    35/45

    Example:

    Six models of cars were rated for style and performance by customers at two

    different locations. The table below shows the average ratings by the customers.

    The scale is from 1 to 100.

    Car model J K L M N P

    Location 1 50 78 32 90 63 42

    Location 2 40 49 33 55 80 33

    Is there a relationship between the two ratings. Prove by calculating the

    Spearmans rank correlation coefficient.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    36/45

    Car

    model

    Location 1

    x

    Location 2

    y

    Rank of x

    Rank of y

    = - ()

    J 50 40 3 3 0 0

    K 78 49 5 4 1 1

    L 32 33 1 1.5 -0.5 0.25

    M 90 55 6 5 1 1

    N 63 80 4 6 -2 4

    P 42 33 2 1.5 0.5 0.25

    =6.5

    =1- (.)()

    = 1- = 0.81 = 1

    6 ( 1)

    Spearmans rank correlation coefficient is 0. since this value is close to 1.0, we

    conclude that there is a very strong positive linear relationship between variable

    x and y.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    37/45

    Example :

    In a singing competition, two judges ranked the seven finalists as shown in the

    table below. Compute spearmans rank correlation coefficient of the two sets of

    rating. What can be said about the ratings of the two judges?

    Finalists A B C D E F

    Judge 1 5 6 3 9 4 8

    Judge 2 3 4 1 8 5 10

  • 7/28/2019 Presentation Chapter 6 MTH1022

    38/45

    Finalists Judge 1

    x

    Judge 2

    y

    Rank of x

    Rank of y

    ()

    A 5 3 3 2 1 1

    B 6 4 4 3 1 1C 3 1 1 1 0 0

    D 9 8 6 5 1 1

    E 4 5 2 4 -2 4

    F 8 10 5 6 -1 1

    G 10 11 7 7 0 0

    =8

    =1- ()()

    = 1-

    = 0.86 = 1 6

    ( 1)Spearmans rank correlation coefficient is 0.86. since this value is close to 1.0,

    we conclude that there is a very strong positive linear relationship between

    variable x and y.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    39/45

    = +

    The method to find the equation is by using Least Squares Method.

    General equation:

    = ( ) =

    Where:

    n is the number of data

  • 7/28/2019 Presentation Chapter 6 MTH1022

    40/45

  • 7/28/2019 Presentation Chapter 6 MTH1022

    41/45

    Example:

    Find the least squares regression line of y on x for the following data.

    X 3 6 9 11 16 18

    y 2 8 11 14 19 21

    Determine the values of y when (a) x = 5 and (b) x = 14

  • 7/28/2019 Presentation Chapter 6 MTH1022

    42/45

    x y xy3 2 9 4 6

    6 8 36 64 48

    9 11 81 121 9911 14 121 196 154

    16 19 256 361 304

    18 21 324 441 378

    = 6 3 = 7 5 =827 =1187 = 9 8 9

    The regression line is y = a + bx and

    =

    ( )

    = 6 989 (63)(75)6 827 (63) =

    = 1.218

    =

    = 756 1.218 636 = - 0.289

    Thus, the regression line is y = - 0.289+1.218x

    When x = 5, y = - 0.289+(1.218 5 ) = 5.801When x = 14, y = - 0.289+(1.218 14 ) = 16.763

  • 7/28/2019 Presentation Chapter 6 MTH1022

    43/45

    Example : The table below gives the pairs of measurements for two variables x

    and y.

    X 5 9 12 15 18 20

    y 3 5 8 9 10 12

    Find the regression line of y on x using the least squares method. Estimates thevalue of y when x = 11.

  • 7/28/2019 Presentation Chapter 6 MTH1022

    44/45

    x y xy 5 3 15 25 9

    9 5 45 81 25

    12 8 96 144 6415 9 135 225 81

    18 10 180 324 100

    20 12 240 400 144

    = 79 = 47 = 711 = 1199 = 423

    = ( )

    = ()()

    ()

    =

    = 0.58

    =

    = 47

    60.58 79

    6

    = 7.63 7.637

    = 0.196

    Thus, the regression line is y = 0.196+0.58x

    When x = 11, y = 0.196+ (0.58 11)=6.679

  • 7/28/2019 Presentation Chapter 6 MTH1022

    45/45

    THE ENDPlease Do a Lot of ExercisesTHANK YOU

    https://mth1022icam.blogspot.com

    JUST REMEMBER: