Anda di halaman 1dari 32

ANALISIS REGRESI LINIER

BUDIONO
Departemen IKM-KP
Fakultas Kedokteran Unair
REGRESI LINIER
bentuk hubungan antara variabel bebas dengan variabel
terikat yang digambarkan secara matematis, berupa suatu
garis lurus (linier).
variabel bebas  variabel terikat
(x) (y)
Persamaan regresi

y = a + bx

) slope ()
} intersep ()
Matematika

Y = f (X)  fungsi deterministik / fungsi


matematik sempurna
 pasti / tanpa error

Statistika
- Y bukan fungsi dari X tp regressed Y on X (Y.X)
 Ada kemungkinan error
- Hubungan probabilistik/stochastic
Istilah Regresi  sir Francis Galton :
1880 mengamati sifat pemindahan tabiat orang tua ke
anaknya :
T.B ayah T.B anak laki-laki
Hasil :
Ayah tinggi  cenderung TB anak laki-laki lebih pendek
Ayah pendek  cenderung TB anak laki-laki lebih tinggi

“ TB anak laki-laki cenderung mundur ‘terkembalikan’


(REGRESSED) mendekati nilai tengah populasi”

Fungsi Regresi : PREDICTION


PERSAMAAN REGRESI

Populasi

Yi = a + b Xi + ei ………. Sampel

 atau a : intercept
 atau b : slope/gradien/kemiringan
ui atau ei atau i : random disturbance term
= error term
= stochastic term

xi : I.V = Predictor variable


= Explanatory variable
Yi : D.V = Respon variable
PERSYARATAN / ASUMSI :
1. EKSISTENSI
untuk nilai x yang konstan  Y variabel random
dengan distribusi probabilitas tertentu
2. DISTRIBUSI NORMAL
untuk nilai x tertentu  Y distribusi normal
3. INDEPENDENSI
Yi dengan Yj (i ≠ j) : independen (hati-hati pada
rancangan TIME SERIES)
4. LINIERITAS
nilai rata-rata (mean) dari Y merupakan fungsi
linier / garis lurus dari X


dengan varians

Jika 2 = nol  tiap titik-titik tepat pada gr – regresi


Jika 2 = besar  titik-titik tersebar sekitar gr – regresi

Yi =  +  x1 + I
i = Yi – ( +  xi )
i = Yi - Y/X
5. HOMOSCEDASTICITY = HOMOSKEDASTISITAS
equal variance  varians Y adalah sama untuk
semua nilai X

Y/X
Y=+x

- Bila variance ( 2) tidak sama  HETEROSCEDASTICITY


6. i  N.I.D (0,2)

Normally Independently Distribution

Tak ada Autocorellation


i dengan j  hati-hati pada
time series design

 = O
Varians = 2
Tentukan / Identifikasikan :
IV & DV
(logika, fakta empiris & teori)

Data Hasil Penelitian

Plotkan dalam grafik


( SCATTER DIAGRAM)
Indiv X Y Y
Xn Yn
1 X1 Y1
2 X2 Y2
3 X3 Y3
. X1 Y1
.
n Xn Yn
X
Find the line which fits the data best

Find the Equation of the best fitting line


Cara :
- MAXIMUM LIKELIHOOD
- METHOD/PRINCIPLE of LEAST SQUARES  Sering 
di antara semua kemungkinan garis lurus  pilih garis yang
S.S.E : Sums of Squared Errors /
Sums of Squared Residuals / Paling kecil (minimum)
Sums of Squared Deviations
Y prakiraan dari Y sesungguhnya sekecil mungkin (minimum)

Y = a + bx

Yi di
(Xi, Yi)

(X, Y)

a
Xi X
2. Persamaan garis regresi yang sesuai :
Y = a + bx atau Y =  0 + 1 x
a = intercept (Y axis), perpotongan garis regresi dengan
sb tegak bila a = nol  garis lewat titik asal (0,0)
b = slope, koefisien regresi, kemiringan garis – regresi
 perubahan satu unit/satuan pada x
mengakibatkan perubahan b satuan pada Y
- b dapat + atau –

Y = a + bx  hubungan fungsional  nilai x


menentukan Y
Y = nilai ramalan yang dihasilkan garis regresi untuk
nilai x tertentu
X = variabel bebas atau prediktor atau explanatory
variable
Penghitungan slope & intercept :
Dengan kalkulus diferensial dari persamaan regresi 

atau

a
atau

a 
Y i
- b.
X i
n n
estimasi
INFERENSI GARIS REGRESI
uji hipotesis
Persamaan garis regresi di populasi
Ypop =  + x
Y1X =  + x
 &  : nilai dugaan slope & intercept di populasi
berdasarkan a & b di sampel
(X i, Yi)
Y
e Y =  + x

Y1X =  + x

Setiap pengamatan (Xi , Yi ) dengan X


X tertentu berlaku Y = Y1X + i
i = random disturbance = error term = galat acak :
simpangan vertikal dari titik tertentu terhadap garis
regresi populasi.
Garis regresi sampel :
Y i = Yi + e i
ei = sisa = residu
I. ESTIMASI  & 
Berhubung variansi populasi sering tidak diketahui, mk 2 ditaksir
dari S.D sampel sebagai unbiased estimator bagi 2
Sehingga :

 Y
2
  Y  /n   b XY -  X Y/n 
2

S2Y.X 
n2
1. Menaksir  :
Selang kepercayaan (1-) 100 % bagi parameter 
dalam garis regresi µY/X =  + x
a + t/2 ; df = n – 2.SE(a)

2. Menaksir  :
Selang kepercayaan (1-) 100 % bagi parameter 
dalam garis regresi µY/X =  + x
b + t/2 ; df = n – 2.SE(b)
II. UJI HIPOTESIS
1. Uji hipotesis a (intercept) :
H0 :  = 0  garis regresi lewat titik asal (0,0)
H1 :   0  garis regresi tidak lewat titik asal

a- a
Uji statistik : t= =
SE(a) SE(a)

H0 : ditolak bila t > t1-/2 , df = n -2 atau


t < t/2 , df = n - 2
2. Uji hipotesis b (slope) :
H0 :  = 0  Y tidak tergantung pada X
H1 :   0  Y tergantung pada X
b- b
Uji statistik : t= =
SE(b) SE(b)

H0 : ditolak bila t > t1-/2 , df = n -2 atau

t < t /2 , df = n - 2
UJI SIGNIFIKANSI PERSAMAAN REGRESI
H0 : tidak terdapat pengaruh X terhadap Y
H1 : ada pengaruh X terhadap Y
MSR
Fratio = = ….
MSE

Tabel Anova untuk Regresi


SBR Variasi DF S.S M.S Fratio p
Due to regresn 1 (Yi –Y)2 SSR/1 MSR
……..
RESIDU n-2 SSE/n-2 MSE
(ERROR) (Yi –Y)2

(Yi –Y)2
Yi – Y = total deviation
= (Yi – Y) + (Yi – Y)
= unexplained variation + explained variation
Jumlah kuadrat (sum of squares)
(Yi – Y)2 = (Yi – Y)2 + (Yi – Y)2
Total S.S = Error SS + Regression S.S
Koefisien penentu = coefficient of determination (r 2) :

Explained Variation Regression SS


r =
2
=
Total Variation Total SS
Yaitu : Proporsi/persentase varian total di Y yang dapat
diterangkan oleh X  seberapa jauh model regresi
linier sesuai (fit) terhadap data  index kesesuaian
(index of fit)

r2 = mendekati 1  x menjelaskan sebagian besar variasi di Y

Adjusted r2 =

P = jumlah parameter
Contoh:
Apakah ada pengaruh lama hemodialisis (bulan) terhadap
kadar kalsium total dalam darah?
No Lama (X) Kalsium (Y) X2 Y2 XY
1 6 13,8 36 190 82,8
2 7 9,5 49 90,3 66,5
3 8 9 64 81 72
4 10 8,6 100 74 86
5 12 8,4 144 70,6 101
6 13 8,2 169 67,2 107
7 14 8 196 64 112
8 15 7,8 225 60,8 117
9 17 7,6 289 57,8 129
10 18 7,4 324 54,8 133
n = 10 Xi = 120 Yi = 88,3 Xi 2= 1596 Y2 = 811 XiYi = 1006
1. Slope (b) :
 Xi Yi  ( Xi )( Yi )/n 811  (120)(88,3)/10
b 
2 2 1596  (120)2 /10
 Xi  ( X) /n

811  1059,6  248,6


b   1,6
1596  1440 156

2. Intercept (a) :
a  Y  bX
a  8,83  (1,6x12)
a  28,03
3. Persamaan garis regresi : Y= 28,03 - 1,6X
4. Menghitung varians (S2)
No (Yi) Yi=28,03 - 1,6X (Yi - Yi)2
1 13,8 18,43 21,44
2 (Y  Ŷ )
2 9,5 16,83 53,73
S  i i
3 9 15,23 38,81 n 2
4 8,6 12,03 11,76
259,28
5 8,4 8,83 0,18 
6 8,2 7,23 0,94 10 2
7 8 5,63 5,62  32,41
8 7,8 4,03 14,21
9 7,6 0,83 45,83
S  32,41 5,7
10 7,4 -0,77 66,75
(Yi - Yi) 259,28
5. Menghitung SE

S2 32,41 32,41
Var(b)     0,208
2 2 2
 X  ( X) /n 1596  (120) /10 156
SE(b)  0,208  0,46

 X 2   12 2 
2 
Var(a)  S 1   
 32,41x 1  
 n X 2  (X)2 /n   10 1596 (120)2 /10 
    
Var(a)  32,41x(0,1 (144/156)) 1,023
SE(a)  1,023  1,01
6. Penaksiran parameter populasi
6.1. Menaksir  :
95 % interval kepercayaan untuk  :a + tn-2 , /2 x SEa
 =28,03 + 2,31 x 1,01
 = 28,03 + 2,33

6.2. Menaksir  :
95 % confidence interval untuk  :
b ± t /2, n-2 x SE b
-16 + 2,31 x 0,46 = -1,6 + 1,06
7. Uji Hipotesis
7.1 Uji hipotesis a :
a 28,03
t   27,25
SE (a) 1,01
titik kritis t  0,05 df 10-2 adalah + 2,31
H0 ditolak
7.2. Uji hipotesis b :
b  1,6
t   3,48
SE (b) 0,46

titik kritis t  0,05 df 10-2 adalah + 2,31


H0 ditolak
Koefisien korelasi
 XY  (  X )(  Y )/n
r
 2  ( X )2   2  ( Y )2 
 X     Y  
n   n

   
    
1006  (120x88,3) /10
r
  120 2     88,3 2  
1596     X 811   
 10  10 
     
 53,6  53,6
r   0,77
156x31,3 69,88

r2 = 0,772 = 0,59
Ajusted r2 :

2 2 (n  1)
r  1  (1  r )x
o (n  p)
2 (10  1)
r  1  (1  0,59)x
o (10  2)
r 2  1  0,46  0,54
o

Anda mungkin juga menyukai