Você está na página 1de 71

ANALISIS REGRESI

DAN KORELASI

MASALAH k PEUBAH (k 2)
APA BILA PENGUKURAN/PENGAMATAN TERHADAP OBJEK
YANG MENJADI PERHATIAN ADA DUA ATAU LEBIH (SETIAP
HASIL ADALAH PASANGAN DUA ATAU LEBIH), MAKA DUA
HAL YANG MENARIK UNTUK DIPERHATIKAN ADALAH :

1. BAGAIMANA ERATNYA HUBUNGAN


2. BAGAIMANA BENTUK HUBUNGAN

SALAH SATU UKURAN KEERATAN HUBUNGAN YANG


BANYAK DIGUNAKAN ADALAH
KOEFISIEN KORELASI PEARSON

X
n

X Yi Y

i 1

X
n

X .
2

i 1

-0,75

i 1

-0,25

-1

Y Y
n

0,25
0

1
0,75

1 r 1
ERAT

ERAT
negatif

positif

AWAS !!

jika r = 0 artinya tidak ada hubungan linear antara X dan Y


keeratan hubungan yang ditunjukkan adalah keeratan
hubungan linear

- Ho 0

versus

H1 A. 0
B. > 0
C. < 0

- = ???, pilih 5 % atau 10 % atau

- daerah kritis/kriteria uji :


tentukan statistik uji
untuk uji koefisien korelasi (= ) digunakan koef.
korelasi sampel (= r)

1
2

n2
~ t n 2
karena r
2
1 r
A. Ho ditolak jika

, maka

t t
2

;(n 2)

B. Ho ditolak jika

t t ;(n 2)

C. Ho ditolak jika

t t ;(n 2)

- Perhitungan :
- Kesimpulan :

atau

t t
2

;(n 2)

=>

r ~ ??

1 1 r
z ln
acrtgh r
2 1 r
1 1
1

z ~ N ln
,
2 1 n 3
=> uji hipotesis untuk :

- H o o versus H1 A. o
B. > o
C. < o
- = ???, pilih harga 0 %

- Kriteria uji :
A. Ho ditolak jika z z o

n 3 z
2

Ho diterima jika z z o

n 3 z
2

z z o n 3 z
Ho diterima jika z z o n 3 z

B. Ho ditolak jika

C. Ho ditolak jika z z o n 3 - z
Ho diterima jika z z o n 3 - z

=> interval konfidensi untuk :


dari

1 1 r
1
1 1 1 1 r
1
ln
z.
ln
ln
z.
2 1 r
n 3 2 1 2 1 r
n 3
2
2
menjadi

z
z

2
2
tgh z
tgh z

n 3
n 3

dengan

1 1 r
ea ea
z ln
dan tgh (a) a
2 1 r
e e a

Patient
Number

Method I

Method II

132

130

138

134

144

132

146

140

148

150

152

144

158

150

130

122

162

160

19

168

150

11

172

160

12

174

178

13

180

168

14

180

174

15

188

186

16

194

172

17

194

182

18

200

178

19

200

196

20

204

188

21

210

180

22

210

196

23

216

210

24

220

190

25

220

202

BENTUK PERSAMAAN HUBUNGAN ANTARA SUATU


VARIABEL (DEPENDEN VARIABEL) DENGAN PALING
SEDIKIT SATU VARIABEL (INDEPENDEN VARIABEL)
ADALAH PERSAMAAN REGRESI

UNTUK MEMPERKIRAKAN BENTUK TEPAT SUATU


PERSAMAAN REGRESI TERLEBIH DAHULU DILAKUKAN
LANGKAH-LANGKAH BERIKUT :

ANALISIS REGRESI
Metode estimasi koef. Regresi menggunakan OLS
(BLUE), syaratnya:
Hubungan Y dan X adalah linier [parameter]
Nilai X tetap untuk observasi yang berulang-ulang
(non-stokastik).
Tidak ada korelasi antar variabel bebas (multikol)
Nilai harapan atau rata-rata dari variabel gangguan
(e) adalah nol.
Varian dari variabel gangguan adalah sama
(homo).
Tidak ada korelasi antar variabel gangguan
(korelasi serial = autokorelasi).
Variabel gangguan berdistribusi normal.

CONTOH
(1.6, 5.5) , (1.0, 6.7) , (1.1, 5.5), (1.2, 5.7) , (1.3, 5.2)
(1.7, 4.5), (2.9, 3.8) , (2.9, 3.8) , (4.2, 3.6), (5.4, 3.5)

e 3.0754.5013X
Y

Y 26.52 2.39X 79.52 X

Y 21.27 6.86X .58X 2

7.88 1.16X
Y

Y f(x)

, ~ (0, 2 )

X,Y

(X1 , Y1 ), (X 2 , Y2 ), ... , (X n , Yn )
Scatter Plot
Kecenderungan garis lurus

f(x) x atau o 1x
Inferensi ???

dengan metode kuadrat terkecil


b//1

X Y X Y
n X X
i

a// o Y X,
1

1
n

b r.

sy
sx

1
n

Xi

dan Y

s y std.dev y
s x std.dev x

2y x

a ~ ,
n

X
i

2y x

b ~ ,
n
jika 2 tidak diketahui,
yx

Xi

s 2y x

2y x diduga dengan

n2

n 1 2

s y b 2s 2x
n2

Inferensi untuk atau atau Y


a bx
a atau b atau y

Xx

berdasarkan

untuk inferensi

X x

, perhatikan bahwa , , dan koefisien


determinasi (=2) harus signifikan

diduga dengan

1
y

y i y i n 2
i

yi n 1

MULTIPLE
REGRESSION

MULTIPLE REGRESSION
The test you choose depends on level of measurement:
Independent Variable

Dependent

Variable

Test

Dichotomous

Interval-Ratio

Independent Samples t-test

Dichotomous
Nominal

Nominal

Cross Tabs

Dichotomous

Dichotomous

Nominal

Interval-Ratio

Dichotomous

Dichotomous

Interval-Ratio

Interval-Ratio

Bivariate Regression/Correlation

Interval-Ratio

Multiple Regression

ANOVA

Dichotomous
Two or More
Interval-Ratio
Dichotomous

MULTIPLE
REGRESSION
Multiple Regression is very popular among social
scientists.
Most social phenomena have more than one cause.
It is very difficult to manipulate just one social variable through
experimentation.
Social scientists must attempt to model complex social
realities to explain them.

MULTIPLE
REGRESSION
Multiple Regression allows us to:
Use several variables at once to explain the variation in
a continuous dependent variable.
Isolate the unique effect of one variable on the
continuous dependent variable while taking into
consideration that other variables are affecting it too.
Write a mathematical equation that tells us the overall
effects of several variables together and the unique
effects of each on a continuous dependent variable.
Control for other variables to demonstrate whether
bivariate relationships are spurious

MULTIPLE REGRESSION
So what does our equation tell us?

Y = 11.8 - .36X1 - .40X2


Expected # of Children = 11.8 - .36*Educ .40*Income

Try plugging in some values for


your variables.

MULTIPLE REGRESSION
So what does our equation tell us?
^

Y = 11.8 - .36X1 - .40X2


Expected # of Children = 11.8 - .36*Educ .40*Income
If Education equals:&
children equals:

If Income Equals: Then,

11.8

10

8.2

10

10

4.2

20

10

0.6

MULTIPLE
REGRESSION
So what does our equation tell us?
^

Y = 11.8 - .36X1 - .40X2


Expected # of Children = 11.8 - .36*Educ - .40*Income
If Education equals:&
equals:

If Income Equals: Then, children

11.44

11.04

9.44

10

7.44

MULTIPLE
REGRESSION
So what does our equation tell us?
^

Y = 11.8 - .36X1 - .40X2


Expected # of Children = 11.8 - .36*Educ - .40*Income
If Education equals:&
equals:

If Income Equals: Then, children

11.40

11.04

9.60

10

7.80

MULTIPLE
REGRESSION
If graphed, holding one variable constant produces a twodimensional graph for the other variable.
Y 11.40

11.44

b = -.36

b = -.4
6.00

15

X1 = Education

5.44
0

X2 = Income

15

MULTIPLE
REGRESSION
An interesting effect of controlling for other variables is
Simpsons Paradox.
The direction of relationship between two variables can change
when you control for another variable.

Education

Crime
Rate

Y = -51.3 +
1.5X

MULTIPLE
REGRESSION
Simpsons Paradox

Educati
on
Urbanization
(is related to
both)

Crime
Rate

Education

Y = -51.3 +
1.5X1

+
Crime Rate

Regression Controlling for


Urbanization

Education
Crime
Y = 58.9 - .6X1 +
+
Urbanization
Rate
.7X2

Two variable model


Y
Yi

Y b0 b1 X 1 b2 X 2

<

Residual = ei
= (Yi Yi)

Sample
observation

<

Yi
x2i

X1

<

x1i

X2

The best fit equation, Y ,


is found by minimizing the
sum of squared errors, e2

inferensi untuk parameter :

Ho o

versus

H1 A. o
B. o
C. o

daerah kritis/kriteria uji :

- o
untuk menguji digunakan karena
~ t n 2 , maka
s

A. Ho ditolak jika

t t
2

;(n 2)

atau t t

B. Ho ditolak jika

t t ; (n 2)

C. Ho ditolak jika

t t ; (n 2)

;(n 2)

inferensi untuk parameter :

Ho o

versus

H1 A. o
B. o
C. o

daerah kritis/kriteria uji :

o
untuk menguji digunakan karena
~ t n 2 , maka
s

A. Ho ditolak jika

t t
2

;(n 2)

atau t t

B. Ho ditolak jika

t t ; (n 2)

C. Ho ditolak jika

t t ; (n 2)

;(n 2)

Masalah regresi linear ganda :


Y o

i Xi

, ~ (0, 2 )

i 1

ambil sampel acak sederhana berukuran n

Yi , X i1 , X i2 ,..., X ik

, i 1,2,..., k

model regresi sampel adalah

Yi o 1X i1 2 X i2 ... k X ik i

i.i.d

, i ~ (0, 2 )

ditulis dalam notasi vektor dan matriks

~ X ~
~

dengan :

, ~ ~ ~0 , 2 I

Y
Y
...
Y
1 2
n
~

~ 1 2 ... n

1 2 ... n
~

1
.
X
.

.
1

X11
X 21
.
.
.
X n1

X12 ... X1k

X 22 ... X 2k
.
.

.
.

.
.
X n2 ... X nk

masalah : ??

, dan jika 2 tak diketahui 2 ??

dengan MKT, yaitu cari ~ yang meminimumkan

i 1

diperoleh

2
1

~ ~

1
XX X Y
~

Yang mempunyai sifat BLUE untuk ~

best

linear unbiased estimator

inferensi untuk atau A ??


~

perlu ditambah dengan asumsi distribusi


yang lazim digunakan adalah

~ N(0, 2 )

atau

~ ~ N n (0, 2 I)

perlu dicatat bahwa model regresi

Y X ~
~

, ~ ~ N n ( ~0 , 2 I)

dikenal pula sebagai model regresi klasik

LANJUT
Mengartikan b1 dan b2 dalam model regresi berganda:

b1 mengukur perubahan rata-rata Y


terhadap perubahan per unit X1 ,
sementara X2 diasumsikan tetap. Hal
yang sama untuk b2.
Jika modelnya non linier misalnya
model non linier log-log, maka
intepretasi dari masing-masing
parameter regresinya adalah
elastisitas.

LANJUT
Pengujian yang diperlukan:
Uji t Koef. Regresi Parsial
Koef. Determinasi yang disesuaikan (tidak
terkait banyaknya variabel independen).
Uji Hipotesis Koef. Regresi secara Menyeluruh
(Uji F).
Uji Asumsi OLS/Klasik (multikolinieritas,
heteroskedastisitas, otokorelasi, dan
normalitas).
Uji Perubahan Struktural Model Regresi (Uji
Chow).
Uji Stabilitas Model (CUSUM dan CUSUMQ).
Uji validitas model (Ramsey Reset Test)

Nilai F-statistik:
Jika nilai F-stat > F-tabel : Semua variabel
independen memiliki joint impact terhadap
variabel dependen

Nilai R2 :
Jika R2 = a artinya semua variabel
independen yang ada dalam model dapat
menerangkan (a*100) persen variasi dari
variabel dependen

MULTIPLE LINEAR REGRESSION


MODELS
Example 1

MULTIPLE LINEAR REGRESSION


MODELS
Example 1

MULTIPLE LINEAR REGRESSION


MODELS
Example 12-1

MULTIPLE LINEAR REGRESSION


MODELS
12-1.3 Matrix Approach to Multiple Linear Regression
Suppose the model relating the regressors to the
response is

In matrix notation this model can be written as

MULTIPLE LINEAR REGRESSION


MODELS
12-1.3 Matrix Approach to Multiple Linear Regression

where

MULTIPLE LINEAR REGRESSION


MODELS
12-1.3 Matrix Approach to Multiple Linear Regression
We wish to find the vector of least squares
estimators that minimizes:

The resulting least squares estimate is

MULTIPLE LINEAR REGRESSION


MODELS
12-1.3 Matrix Approach to Multiple Linear Regression

MULTIPLE LINEAR REGRESSION


MODELS
Example 12-2

Example 2

MULTIPLE LINEAR REGRESSION


MODELS
Example 12-2

MULTIPLE LINEAR REGRESSION


MODELS
Example 12-2

PENGUJIAN ASUMSI
OLS
Multikolinieritas
Deteksi
Nilai R2 tinggi namun hanya sedikit variabel
independen yang signifikan.
Korelasi parsial antar variabel independen.
Regresi Auxiliary Membuat regresi antar
variabel independen.
Metode Klien
Membandingkan nilai R2 regresi auxiliary dengan R2
regresi awal.
Rule of thumb-nya, jika R2 Auxiliary > R2 awal
mengandung unsur multikol, dan sebaliknya.

LANJUT
Penyembuhan
Doing nothing
BLUE tidak asumsi tidak adanya multikolinieritas
Adanya multiko akan berdampak sulitnya memperoleh
standar error yang kecil.
Doing something
Menghilangkan variabel independen yang memiliki
korelasi yang kuat.
Transformasi variabel
Bentuk diferensi pertama kelemahannya mungkin
terjadi korelasi serial (otokorelasi) Melanggar
asumsi OLS.
Penambahan Data

LANJUT
Heteroskedastisitas
Deteksi
Informal
Pola residual (Homo = tidak pasti; Hetero = tertentu)
Formal
Metode Park
Metode Glejser
Metode Korelasi Spearman
Metode GoldFeld-Quandt
Metode Breusch-Pagan
Metode White

CONSEQUENCES OF
HETEROSKEDASTICITY
If heteroskedasticity appears but OLS is used for estimation,
how are the OLS estimates affected?

E k k
ECON 7710, 2010

k 0,1,, K

10.56

Unaffected: OLS estimators are still linear and


unbiased because, on average, overestimates
are as likely as underestimates.

1 OLS estimators are inefficient.

Some fluctuations of the error term are attributed to the variation


in independent variables.

ECON 7710, 2010

10.57

There are other linear and unbiased estimators that have


smaller variances than the OLS estimator.

2 Unreliable Hypothesis Testing

var

ols

var hetero
k
k

biased se k

ECON 7710, 2010

10.58

unreliable testing conclusion

LANJUT
Metode Park
Hetero muncul karena residual tergantung dari variabel
independen.
Prosedur:
Estimasi regresi awal, lalu perolah residualnya.
Estimasi regresi antara residual kuadrat dengan variabel
independen.
Jika variabel independen signifikan, maka mengandung
heteroskedastisitas.

PARK TEST
Model
Yi = 0 + 1X1i + + KXKi + t i = 1,,N (*)
Suppose it is suspected that var(i) depends on Zi
in the form of
var(i) = i2 = 2Zi1evi
Ho: 1 = 0 (Homoskedastic errors);
HA: 1 0 (Heteroskedastic errors).

ECON 7710, 2010

10.60

lni2 = ln2 + 1lnZki + vi

Advantages of the Park test:


a. The test is simple.
b. It provides information about the variance structure.

Limitations of the Park test:


a. The distribution of the dependent variable is
problematic.
c. It does not work when the variance depends on two or
more variables.
d. The correct variable with which to order the
observations must be identified first.
e. It cannot handle partitioned data.
ECON 7710, 2010

10.61

b. It assumes a specific functional form.

LANJUT
Metode Glejser
Hetero karena varian variabel gangguan nilainya tergantung
dari variabel independen.
Prosedur:
Regresikan nilai absolut variabel gangguan dengan
variabel independen.
Indikator simpulan sama dengan Park

LANJUT
Metode Korelasi Spearman
Prosedur:
Peroleh residual dari estimasi model awal.
Absolutkan nilai residualnya, lalu diurutkan. Lakukan hal
yang sama untuk variabel X.
Cari korelasi antara keduanya.
Gunakan uji t Jika t hitung > t tabel, maka terdapat
heteroskedastisitas.

LANJUT
Metode GoldFeld-Quandt
Memperbaiki kelemahan Park dan Glejser
Hetero varian variabel gangguan merupakan
fungsi positif dari variabel independen.
Prosedur:

Urutkan data sesuai dengan nilai X (kecil besar)


Hilangkan observasi yang ditengah.
Membagi data yang tersisa (n c)
Buat regresi pada masing-masing kelompok secara
terpisah [(n c)/2].
Peroleh nilai RSS1 dan RSS2.
Hitung rasionya [(RSS2/df)/(RSS1/df)] bandingkan
dengan F tabel.

Whites Test

Model
Yi = 0 + 1X1i + 2X2i + i i = 1,,N (*)
Suppose it is suspected there may be
heteroskedasticity but we are not sure of its
functional form.

HA: The conditional variance of i is not constant.


ECON 7710, 2010

10.65

Ho: The conditional variance of i is constant.

Step 1: Estimate the equation (*) with OLS and


obtain the residuals.

ei Yi Yi Yi 0 1 X 1i 2 X 2i
Step 2: Regress the squared residuals on all
explanatory variables, all cross product terms and
the square of each explanatory variable.
ei2 = 0 + 1X1i + 2X2i
+ 5X1iX2i + vi
ECON 7710, 2010

10.66

+ 3X1i2 + 4X2i2

Step 3: Test the overall significance of the


equation in Step 2. (df = number of regressors)
Statistic = NR2white ~ 2df
Critical value (cv) = 2df,

Example 4: White test: US data (UE_Tab0301)


^
e2 = 1924 7.4 income + 0.0088income2*
R2 = 0.3646, N = 40, NR2 = 14.58
cv = 2(2, 0.01) = 9.21.
ECON 7710, 2010

10.67

Reject the hypothesis of homoskedasticity if


NR2err > cv.

LANJUT
Autokorelasi
Adanya autokorelasi dalam regresi maka estimator
Metode OLS masih linier
Metode OLS masih tidak bias
Metode OLS tidak memiliki varian yang minimum lagi.
Menyebabkan perhitungan standard error tidak bisa
dipercaya.
Uji t dan F tidak bisa digunakan sebagai evaluasi hasil
regresi.

LANJUT
Deteksi
Metode Durbin-Watson (DW)
du = < d <= (4-du)
Metode Breusch-Godfrey
LM-test

Penyembuhan
Nilai rho atau koef. Model AR(1) diketahui.
Nilai rho tidak diketahui namun bisa dicari melalui estimasi.

LANJUT
Nilai rho diketahui
Transformasi persamaan metode generalized
difference equation.
Prosedur:
Model awal dan residual mengikuti pola AR(1).
Buat persamaan dengan lag satu dari model regresi
awal.
Kalikan kedua sisi dengan rho yang diperoleh dari
pers. AR(1)
Kurangi pers. Awal dengan pers. tadi.

LANJUT
Nilai rho tidak diketahui
Estimasi nilai rho
Metode Diferensi Tingkat Pertama R2 > d
Berenblutt-Webb.
Statistik d Durbin Watson
Metode 2 langkah Durbin
Metode Cochrane-Orcutt

Você também pode gostar