regresi (1)

download regresi (1)

of 37

Transcript of regresi (1)

  • 8/3/2019 regresi (1)

    1/37

    2002 Prentice-Hall, Inc. Chap 11-1

    Analisis Regresi

    Noorlaily Fitdiarini, SE., MBA.

  • 8/3/2019 regresi (1)

    2/37

    2002 Prentice-Hall, Inc. Chap 11-2

    Tujuan Analisis Regresi

    X2 tests of independence digunakan untukmenentukan adanya suatu hubungan statistikantara 2 variabel, tetapi tidak menyebutkanbagaimana hubungannya.

    Analisis Regresi & Korelasi menunjukkan baik sifatmaupun kuatnya suatu hubungan antara keduavariabel tersebut.

    Setiap regresi pasti ada korelasinya, tetapi korelasibelum tentu dilanjutkan oleh regresi.

    Korelasi yang tidak dilanjutkan dengan regresiadalah korelasi antara 2 variabel yang tidakmempunyai hubungan kausal/sebab-akibat, atauhubungan fungsional (berdasarkan teori/konsep)

  • 8/3/2019 regresi (1)

    3/37

    2002 Prentice-Hall, Inc. Chap 11-3

    Macam-macam Model Regresi

    Positive Linear Relationship

    Negative Linear Relationship

    Relationship NOT Linear

    No Relationship

  • 8/3/2019 regresi (1)

    4/37

    2002 Prentice-Hall, Inc. Chap 11-4

    Model Regresi Linear Sederhana

    Hubungan di antara 2 variabeldigambarkan dengan fungsi linear

    Perubahan pada satu variabelmenyebabkan perubahan pada variabelyang lain

    Ada ketergantungan satu variabelterhadap yang lain

  • 8/3/2019 regresi (1)

    5/37

    2002 Prentice-Hall, Inc. Chap 11-5

    Regresi Linear

    Y interceptSlopeCoefficient

    Random

    Error

    Dependent(Response)Variable

    Independent(Explanatory)Variable

    ii iY X

  • 8/3/2019 regresi (1)

    6/37

    2002 Prentice-Hall, Inc. Chap 11-6

    Regresi Linear(continued)

    ii iY X

    = Random Error

    Y

    X

    (Observed Value of Y) =

    Observed Value of Y

    i

  • 8/3/2019 regresi (1)

    7/37 2002 Prentice-Hall, Inc. Chap 11-7

    Interpretasi dariSlope dan Intercept

    adalah rata-rata dari nilai Y

    jika nilai X sama dengan 0.

    mengukur perubahan pada

    rata-rata nilai Y sebagai akibat dari perubahansatu unit X.

    | 0E Y X

    1

    |E Y X

    X

  • 8/3/2019 regresi (1)

    8/37 2002 Prentice-Hall, Inc. Chap 11-8

    adalah rata-rata dari nilai Y

    yang diestimasi jika nilai X sama dengan 0.

    perubahan yang diestimasi

    pada rata-rata nilai Y sebagai akibat dari perubahan

    satu unit X.

    (continued)

    | 0b E Y X

    1

    |E Y Xb

    X

    Interpretation of theSlope and the Intercept

  • 8/3/2019 regresi (1)

    9/37 2002 Prentice-Hall, Inc. Chap 11-9

    Regresi Linear Sederhana:Contoh Kasus

    Anda ingin mengujiketergantungan linear

    dari penjualan tahunandari suatu tokoterhadap ukuran/luastoko. Sampel data

    untuk 7 toko diperoleh.Bagaimana persamaangaris lurus yang palingsesuai dengan datatersebut?

    AnnualStore Square Sales

    Feet ($1000)

    1 1,726 3,6812 1,542 3,395

    3 2,816 6,653

    4 5,555 9,543

    5 1,292 3,318

    6 2,208 5,563

    7 1,313 3,760

  • 8/3/2019 regresi (1)

    10/37 2002 Prentice-Hall, Inc. Chap 11-10

    Scatter Diagram: Contoh Kasus

    0

    2 0 0 0

    4 0 0 0

    6 0 0 0

    8 0 0 0

    1 0 0 0 0

    1 2 0 0 0

    0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0

    S q u a re F e e t

    A

    nnualSales

    ($000)

    Excel Output

  • 8/3/2019 regresi (1)

    11/37 2002 Prentice-Hall, Inc. Chap 11-11

    Persamaan Garis Regresi:Contoh Kasus

    0 1

    1636.415 1.487

    i i

    i

    Y b b X

    X

    From Excel Printout:

    Coef f ic ients

    I n t e r c e p t 1 6 3 6 . 4 1 4 7 2 6

    X V a r i a b l e 1 . 4 8 6 6 3 3 6 5 7

  • 8/3/2019 regresi (1)

    12/37 2002 Prentice-Hall, Inc. Chap 11-12

    Graph of the SampleRegression Line: Example

    0

    2 0 0 0

    4 0 0 0

    6 0 0 0

    8 0 0 0

    1 0 0 0 0

    1 2 0 0 0

    0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0

    S q u a r e F e e t

    A

    nnualSales

    ($000)

  • 8/3/2019 regresi (1)

    13/37 2002 Prentice-Hall, Inc. Chap 11-13

    Interpretation of Results:Contoh Kasus

    Slope = 1.487 berarti bahwa untuk setiappeningkatan satu unit X, kita memprediksikan rata-rata Y akan meningkat kira-kira sebesar 1,487 unit

    Jadi setiap peningkatan 1 sq foot ukuran toko,diperkirana penjual tahunan akan meningkatsebesar $1487.

    1636.415 1.487i i

    Y X

  • 8/3/2019 regresi (1)

    14/37 2002 Prentice-Hall, Inc. Chap 11-14

    Measure of Variation:The Sum of Squares

    (continued)

    Xi

    Y

    X

    Y

    SST=(Yi-Y)2

    SSE=(Yi-Yi)2

    SSR=(Yi-Y)2

    _

    _

    _

  • 8/3/2019 regresi (1)

    15/37 2002 Prentice-Hall, Inc. Chap 11-15

    The ANOVA Table in Excel

    ANOVA

    df SS MS FSignificance

    F

    Regression p SSRMSR

    =SSR/pMSR/MSE

    P-value of

    the F Test

    Residuals n-p-1 SSEMSE

    =SSE/(n-p-1)

    Total n-1 SST

  • 8/3/2019 regresi (1)

    16/37 2002 Prentice-Hall, Inc. Chap 11-16

    Measures of VariationThe Sum of Squares: Example

    ANOVAdf SS MS F Significance F

    Regression 1 30380456.12 30380456 81.17909 0.000281201

    Residual 5 1871199.595 374239.92

    Total 6 32251655.71

    Excel Output for Produce Stores

    SSR

    SSERegression (explained) df

    Degrees of freedom

    Error (residual) df

    Total df

    SST

  • 8/3/2019 regresi (1)

    17/37

    2002 Prentice-Hall, Inc. Chap 11-17

    The Coefficient of Determination &Standard Error of Estimate

    Coefficient of Determination

    Mengukur proporsi dari variasi Y yang diterangkanoleh variabel independen X pada model regresi

    Standard Error of Estimate:

    2 Regression Sum of Squares

    Total Sum of Squares

    SSRr

    SST

    2

    1

    2 2

    n

    i

    i

    YX

    Y YSSE

    Sn n

    Standar deviasi dari variasi observasi sekitar garis

    regresi

  • 8/3/2019 regresi (1)

    18/37

    2002 Prentice-Hall, Inc. Chap 11-18

    Measures of Variation:Produce Store Example

    R eg ressio n S ta tistics

    M u l t ip le R 0 . 9 7 0 5 5 7 2

    R S q u a re 0 . 9 4 1 9 8 1 2 9

    A d j u s t e d R S q u a r e 0 . 9 3 0 3 7 7 5 4

    S t a n d a rd E rro r 6 1 1 .7 5 1 5 1 7

    O b s e rva t io n s 7

    Excel Output for Produce Stores

    r2 = .94

    94% dari variasi penjualan tahunandijelaskan oleh variabilitas ukuran toko (yang

    diukur dengan sq foot)

    Syx

  • 8/3/2019 regresi (1)

    19/37

  • 8/3/2019 regresi (1)

    20/37

    2002 Prentice-Hall, Inc. Chap 11-20

    Example: Produce Store

    Data for Seven Stores:EstimatedRegressionEquation:

    The slope of this

    model is 1.487.Is square footage ofthe store affecting itsannual sales?

    AnnualStore Square Sales

    Feet ($000)

    1 1,726 3,681

    2 1,542 3,395

    3 2,816 6,653

    4 5,555 9,5435 1,292 3,318

    6 2,208 5,563

    7 1,313 3,760

    Yi= 1636.415 +1.487Xi

  • 8/3/2019 regresi (1)

    21/37

    2002 Prentice-Hall, Inc. Chap 11-21

    Inferences about the Slope:t Test Example

    H0: 1 = 0

    H1: 1 0

    .05df7 - 2 = 5Critical Value(s):

    Test Statistic:

    Keputusan:

    Kesimpulan:Terdapat bukti bahwaukuran toko (sq foot)

    mempengaruhi penjualantahunan.

    t0 2.5706-2.5706

    .025

    Reject Reject

    .025

    From Excel Printout

    Reject H0

    Coefficients Standard Error t Stat P-value

    Intercept 1636.4147 451.4953 3.6244 0.01515

    Footage 1.4866 0.1650 9.0099 0.00028

    1b 1bS t

  • 8/3/2019 regresi (1)

    22/37

    2002 Prentice-Hall, Inc. Chap 11-22

    Inferences about the Slope:Confidence Interval Example

    Confidence Interval Estimate of the Slope:

    11 2n bb t S

    Excel Printout for Produce Stores

    Pada 95% level of confidence, the confidenceinterval untuk slope adalah (1.062, 1.911). Di atas 0.

    Kesimpulan: Terdapat suatu ketergantungan linear

    yang signifikan dari penjualan tahunan terhadapukuran toko.

    Lowe r 9 5% Upper 9 5%

    I n t e r c e p t 4 7 5 . 81 0 9 26 2 7 97 .0 1 85 3

    X V a r ia b l e 1 .0 6 24 9 0 37 1 .9 1 07 7 69 4

  • 8/3/2019 regresi (1)

    23/37

    2002 Prentice-Hall, Inc. Chap 11-23

    ANOVA

    df SS MS F Significance F

    Regression 1 30380456.12 30380456.12 81.179 0.000281Residual 5 1871199.595 374239.919

    Total 6 32251655.71

    Inferences about the Slope:F Test Example

    Test Statistic:

    Decision:

    Conclusion:

    H0:1= 0H1:1 0.05numeratordf = 1denominatordf7 - 2 = 5

    There is evidence thatsquare footage affects

    annual sales.

    From Excel Printout

    Reject H0

    0 6.61

    Reject

    = .05

    1, 2nF

  • 8/3/2019 regresi (1)

    24/37

    2002 Prentice-Hall, Inc. Chap 11-24

    Tujuan dari Analisis Korelasi

    Digunakan untuk mengukur kuatnya hubungan(linear) antara 2 variabel. Tidak ada hubungan kausal

    Population correlation coefficient (Rho) digunakanuntuk mengukur kuatnya hubungan (linear) antara 2variabel.

    Sample correlation coefficient r adalah suatuestimasi dari dan digunakan untuk mengukurkuatnya hubungan (linear) pada sampel observasi

  • 8/3/2019 regresi (1)

    25/37

    2002 Prentice-Hall, Inc. Chap 11-25

    Features ofand r

    Unit free

    Range between -1 and 1

    The closer to -1, the stronger the negativelinear relationship

    The closer to 1, the stronger the positivelinear relationship

    The closer to 0, the weaker the linearrelationship

  • 8/3/2019 regresi (1)

    26/37

    2002 Prentice-Hall, Inc. Chap 11-26

    Test for a Linear Relationship

    Hypotheses

    H0:= 0 (tidak ada korelasi)

    H1: 0 (korelasi)

    Test statistic

    2

    2 1

    2 2

    1 1

    where

    2

    n

    i i

    i

    n n

    i ii i

    rt

    r

    n

    X X Y Y

    r r

    X X Y Y

  • 8/3/2019 regresi (1)

    27/37

    2002 Prentice-Hall, Inc. Chap 11-27

    Example: Produce Stores

    R eg ressio n S tat istics

    M u l t ip le R 0 . 9 7 0 5 5 7 2

    R S q u a re 0 . 9 4 1 9 8 1 2 9A d j u s t e d R S q u a r e 0 . 9 3 0 3 7 7 5 4

    S t a n d a rd E rro r 6 1 1 .7 5 1 5 1 7

    O b s e rva t io n s 7

    From Excel Printout r

    Is there anyevidence of a linear

    relationship betweenthe annual sales of astore and its square

    footage at .05 levelof significance? H0:= 0 (No association)

    H1: 0 (Association).05df7 - 2 = 5

    E l

  • 8/3/2019 regresi (1)

    28/37

    2002 Prentice-Hall, Inc. Chap 11-28

    Example:Produce Store Solution

    0 2.5706-2.5706

    .025

    Reject Reject

    .025

    Critical Value(s):

    Conclusion:There is evidence of alinear relationship at 5%level of significance

    Decision:Reject H0

    2

    .97069.0099

    1 .9420

    52

    rt

    r

    n

    The value of the t statistic isexactly the same as the tstatistic value for test on theslope coefficient

  • 8/3/2019 regresi (1)

    29/37

    2002 Prentice-Hall, Inc. Chap 11-29

    0 1 1 2 2i i i k ki iY b b X b X b X e

    Population

    Y-intercept

    Population slopes Random

    Error

    The Multiple Regression ModelRelationship between 1 dependent & 2 or more

    independent variables is a linear function

    Dependent (Response)

    variable for sample

    Independent (Explanatory)

    variables for sample model

    1 2i i i k ki iY X X X

    Residual

  • 8/3/2019 regresi (1)

    30/37

    2002 Prentice-Hall, Inc. Chap 11-30

    Oil (Gal) Temp Insulation Di

    275.30 40 3 0.0094

    363.80 27 3 0.0098

    164.30 40 10 0.0496

    40.80 73 6 0.0041

    94.30 64 6 0.0001230.90 34 6 0.0295

    366.70 9 6 0.1342

    300.60 8 10 0.1328

    237.80 23 10 0.0001

    121.40 63 3 0.3083

    31.40 65 10 0.1342203.50 41 6 0.0094

    441.10 21 3 0.4941

    323.00 38 3 0.0824

    52.50 58 10 0.0062

    Interpretation of Coefficient of

  • 8/3/2019 regresi (1)

    31/37

    2002 Prentice-Hall, Inc. Chap 11-31

    Interpretation of Coefficient ofMultiple Determination

    96.56% of the total variation in heating oil can be

    explained by different temperature and amount ofinsulation

    95.99% of the total fluctuation in heating oil canbe explained by different temperature and amountof insulation after adjusting for the number ofexplanatory variables and sample size

    2

    ,12 .9656YSSR

    rSST

    2

    adj .9599r

    C ffi i t f M lti l

  • 8/3/2019 regresi (1)

    32/37

    2002 Prentice-Hall, Inc. Chap 11-32

    Coefficient of MultipleDetermination

    Regression Statistics

    M u lt ip le R 0 .9 8 2 6 5 4 7 5 7

    R S q u a re 0 .9 6 5 6 1 0 3 7 1

    A d ju s t e d R S q u a re 0 . 9 5 9 8 7 8 7 6 6

    S ta n d a rd E rro r 2 6 . 0 1 3 7 8 3 2 3

    O b s e rva t io n s 1 5

    Excel Output

    SST

    SSRr ,Y 2

    12

    Adjusted r2

    reflects the number

    of explanatory

    variables and sample

    size

    is smaller than r2

  • 8/3/2019 regresi (1)

    33/37

    2002 Prentice-Hall, Inc. Chap 11-33

    Testing for Overall Significance

    Shows if there is a linear relationship betweenall of the X variables together and Y

    Use F test statistic Hypotheses:

    H0: k=0 (no linear relationship)

    H1: at least one i ( at least one independent

    variable affects Y)

    The null hypothesis is a very strong statement

    Almost always reject the null hypothesis

    T t f O ll Si ifi

  • 8/3/2019 regresi (1)

    34/37

    2002 Prentice-Hall, Inc. Chap 11-34

    Test for Overall SignificanceExample Solution

    F0 3.89

    H0:1=2= =p=0

    H1: At least one i0 = .05

    df = 2 and 12Critical Value(s):

    Test Statistic:

    Decision:

    Conclusion:

    Reject at = 0.05

    There is evidence that atleast one independentvariable affects Y

    = 0.05

    F 168.47(Excel Output)

    T t f Si ifi

  • 8/3/2019 regresi (1)

    35/37

    2002 Prentice-Hall, Inc. Chap 11-35

    Test for Significance:Individual Variables

    Shows if there is a linear relationship betweenthe variable Xiand Y

    Use t test statistic Hypotheses:

    H0: i 0 (no linear relationship)

    H1: i 0 (linear relationship between Xiand Y)

    t T t St ti ti

  • 8/3/2019 regresi (1)

    36/37

    2002 Prentice-Hall, Inc. Chap 11-36

    t Test StatisticExcel Output: Example

    Coefficients Standard Error t StatIntercept 562.1510092 21.09310433 26.65093769

    X Variable 1 -5.436580588 0.336216167 -16.16989642

    X Variable 2 -20.01232067 2.342505227 -8.543127434

    tTest Statistic for X1(Temperature)

    tTest Statistic for X2(Insulation)

    i

    i

    b

    bt

    S

  • 8/3/2019 regresi (1)

    37/37

    t Test : Example Solution

    H0: 1 = 0

    H1: 1 0

    df = 12

    Critical Value(s):

    Test Statistic:

    Decision:

    Conclusion:

    Reject H0 at = 0.05

    There is evidence of asignificant effect oftemperature on oilconsumption.

    t0 2.1788-2.1788

    .025

    Reject H0

    Reject H0

    .025

    Does temperature have a significant effect on monthly

    consumption of heating oil? Test at = 0.05.

    tTest Statistic = -16.1699