28
Dr. Kusman Sadik, M.Si Program Studi Pascasarjana Departemen Statistika IPB, Genap 2018/2019 Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal)

Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

  • Upload
    others

  • View
    16

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

Dr. Kusman Sadik, M.Si

Program Studi Pascasarjana

Departemen Statistika IPB, Genap 2018/2019

Model Regresi Logit Ordinal(Peubah Respon Multikategori-Ordinal)

Page 2: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

2

The main feature of the ordinal logistic models is that

they predict the log odds, odds, or probability of a

response occurring at or below any given outcome

category.

For example, ordering the educational attainment

categories from lowest to highest (less than high

school, high school, junior college, bachelor’s degree,

graduate degree) we can use this model to predict the

probability of being (for example) at the bachelor’s

level or below from age at first marriage.

Page 3: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

3

.... (a)

a

Page 4: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

4

Page 5: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

5

a

Page 6: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

6

The slopes are assumed to be the same for all logits

and, under this assumption, the model is known as

the proportional odds model.

The underlying assumption of equivalent slopes

across all logits can, and should, be tested to verify

that this model is appropriate.

If this assumption appears to be violated, then one

could fit the nominal, or more complicated alternative

models.

Page 7: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

7

We use data from the 2006 GSS to predict a

respondent’s educational attainment level (degree),

measured as either less than high school, high school,

junior college, bachelor’s degree, or graduate degree,

from the respondent’s age when first married

(agewed).

The outcome variable (educational attainment level) is

treated as ordinal, so the proportional odds model is

used.

Page 8: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

8

# Model Logistik Ordinal untuk Data GSS (Azen, sub-bab 10.5)

# Data Respon : Harus Data Terurut

dataku <- read.csv(file=“Data-GSS-2006.csv", header=TRUE)

degree <- factor(dataku$degree)

degree.order <- factor(dataku$degree.order)

agewed <- dataku$agewed

data.frame(degree,degree.order,agewed)

# Package yang diperlukan #

library("foreign")

library("MASS")

library("nnet")

table(degree,degree.order)

model <- polr(degree.order ~ agewed, method="logistic")

summary(model)

Page 9: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

9

degree degree.order agewed

1 HIGH SCHOOL 2 22

2 HIGH SCHOOL 2 23

3 HIGH SCHOOL 2 24

4 HIGH SCHOOL 2 22

5 LT HIGH SCHOOL 1 28

6 LT HIGH SCHOOL 1 21

7 HIGH SCHOOL 2 29

8 LT HIGH SCHOOL 1 19

9 LT HIGH SCHOOL 1 28

10 LT HIGH SCHOOL 1 29

.

.

.

1158 HIGH SCHOOL 2 21

1159 HIGH SCHOOL 2 22

1160 BACHELOR 4 28

Catatan : yang dipakai “degree.order” bukan

“degree”, karena “degree” belum terurut.

Page 10: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

10

degree.order

degree 1 2 3 4 5

LT HIGH SCHOOL 195 0 0 0 0

BACHELOR 0 0 0 185 0

GRADUATE 0 0 0 0 104

HIGH SCHOOL 0 590 0 0 0

JUNIOR COLLEGE 0 0 86 0 0

Page 11: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

11

Coefficients:

Value Std. Error t value

agewed 0.05059 0.01031 4.908

Intercepts:

Value Std. Error t value

1|2 -0.4549 0.2431 -1.8711

2|3 1.9226 0.2501 7.6886

3|4 2.2940 0.2530 9.0670

4|5 3.5242 0.2682 13.1389

Residual Deviance: 3096.156

AIC: 3106.156

Page 12: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

12

Output SAS : Bandingkan dengan Output R

Page 13: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

13

Output SAS : Bandingkan dengan Output R

Page 14: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

14

Perbedaan Model antara R, SPSS, dan SAS

R dan SPSS

SAS

Page 15: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

15

Perbedaan Model antara R, SPSS, dan SAS

Page 16: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

16

Interpretasi dan Pengujian Parameter

Page 17: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

17

Ilustrasi Interpretasi Parameter (Output R)

Coefficients:

Value Std. Error t value

agewed 0.05059 0.01031 4.908

Intercepts:

Value Std. Error t value

1|2 -0.4549 0.2431 -1.8711

2|3 1.9226 0.2501 7.6886

3|4 2.2940 0.2530 9.0670

4|5 3.5242 0.2682 13.1389

Nilai negatif dari β

Page 18: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

18

Ilustrasi Interpretasi Parameter (Output R)

Page 19: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

19

Ilustrasi Interpretasi Parameter (Output R)

Page 20: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

20

Page 21: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

21

1 Gunakan Program R untuk data Mental Impairment (Agresti, sub-

bab 7.2.4, hlm. 279 ) .

a. Bandingkan hasilnya dengan output SAS pada buku Agresti

tersebut serta berikan interpretasi pada tiap nilai dugaan

parameter model.

b. Berdasarkan hasil pada poin (a) di atas, tentukan nilai

dugaan P(Y = 1), P(Y = 3), dan P(Y > 2).

c. Tentukan model terbaik.

Page 22: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

22

Page 23: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

23

2 Kerjakan Problem 10.7 (Azen, 2011)

Page 24: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

24

Page 25: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

25

3 Kerjakan Problem 10.8 (Azen, 2011)

Page 26: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

26

Pustaka

1. Azen, R. dan Walker, C.R. (2011). Categorical Data

Analysis for the Behavioral and Social Sciences.

Routledge, Taylor and Francis Group, New York.

2. Agresti, A. (2002). Categorical Data Analysis 2nd. New

York: Wiley.

3. Pustaka lain yang relevan.

Page 27: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

27

Bisa di-download di

kusmansadik.wordpress.com

Page 28: Model Regresi Logit Ordinal · 14/04/2019  · Model Regresi Logit Ordinal (Peubah Respon Multikategori-Ordinal) 2 The main feature of the ordinal logistic models is that they predict

28

Terima Kasih