Model Log-Linear (Bagian 2) Dr. Kusman Sadik, M.Si Program Studi Pascasarjana Departemen Statistika IPB, 2018/2019

Similar documents
Comparing R print-outs from LM, GLM, LMM and GLMM

> Y=degre=="deces" > table(y) Y FALSE TRUE

INSTITUTE AND FACULTY OF ACTUARIES CURRICULUM 2019 SPECIMEN SOLUTIONS. Subject CS1B Actuarial Statistics

Summary of Main Points

Poisson GLM, Cox PH, & degrees of freedom

Gail E. Potter, Timo Smieszek, and Kerstin Sailer. April 24, 2015

The R survey package used in these examples is version 3.22 and was run under R v2.7 on a PC.

Missing Data Treatments

Faculty of Science FINAL EXAMINATION MATH-523B Generalized Linear Models

PSYC 6140 November 16, 2005 ANOVA output in R

NUTRITIONAL CHARACTERISTICS EVALUATION OF MALAYSIAN COMMERCIAL PINEAPPLE CULTIVARS CHONG HANG CHIET UNIVERSITI TEKNOLOGI MALAYSIA

IWK 102 PRINCIPLES OF BIO-RESOURCE SCIENCE & TECHNOLOGY [ASAS SAINS & TEKNOLOGI BIO-SUMBER (KAYU)]

STAT 5302 Applied Regression Analysis. Hawkins

To: Professor Roger Bohn & Hyeonsu Kang Subject: Big Data, Assignment April 13th. From: xxxx (anonymized) Date: 4/11/2016

wine 1 wine 2 wine 3 person person person person person

RIWAYAT HIDUP ABSTRAK ABSTRACT UCAPAN TERIMA KASIH DAFTAR ISI DAFTAR TABEL DAFTAR GAMBAR DAFTAR LAMPIRAN BAB I PENDAHULUAN

Final Exam Financial Data Analysis (6 Credit points/imp Students) March 2, 2006

IMK 202 Food Commodities [Komoditi Makanan]

Internet Appendix to. The Price of Street Friends: Social Networks, Informed Trading, and Shareholder Costs. Jie Cai Ralph A.

PEMBINAAN JADUAL SPESIFIKASI UJIAN (TABLE OF SPECIFICATION-TOR)

Figure S2. Measurement locations for meteorological stations. (data made available by KMI:

IMK 308 FOOD PRESERVATION PRINCIPLES [PRINSIP PENGAWETAN MAKANAN]

Bahagian A. Di antara berikut, yang manakah merupakan benda hidup?

EFFECT OF BOTTOM ASH ON THE STRENGTH CHARACTERISTICS OF FLY ASH AND BOTTOM ASH MIXTURES JACKY LING JIA YII

A latent class approach for estimating energy demands and efficiency in transport:

DAUN YANG JATUH TAK PERNAH MEMBENCI ANGIN

CAPACITANCE-BASED TIREN CHICKEN MEAT DETECTOR GLOVE AS CHICKEN MEAT SAFETY SOLUTION IN INDONESIA

PERISIAN PENGUJIAN PRESTASI ANTARA DUA BUAH CAKERA KERAS SHAH REZAL BIN RUSLI. Ijazah Sarjana Muda Sains Komputer

THE COMPETITIVENESS OF INDONESIAN PRODUCT IN TRADE RELATIONSHIP WITH CHINA

Preferred citation style

A NEW FEATURE EXTRACTION ALGORITHM FOR OVERLAPPING LEAVES OF RUBBER TREE SULE ANJOMSHOAE

Penghasilan Premix Kopi Biji Betik

*p <.05. **p <.01. ***p <.001.

IDENTIFICATION AND RECOVERY OF FINGERPRINTS FROM GLASS FRAGMENTS IN MOLOTOV COCKTAIL CASES

Comparative Analysis of Dispersion Parameter Estimates in Loglinear Modeling

Q1 Gender / Jantina:

Flexible Working Arrangements, Collaboration, ICT and Innovation

Appendix A. Table A.1: Logit Estimates for Elasticities

Dessert. Halal certified dishes. Amuse. Light Dishes Anytime (The following dishes are available at anytime after the first meal service.

Table 1: Number of patients by ICU hospital level and geographical locality.

IMK 202 FOOD COMMODITIES [KOMODITI MAKANAN]

Dalam profesion menolong, terdapat banyak kod etika yang digunakan oleh golongan

AJAE Appendix: Testing Household-Specific Explanations for the Inverse Productivity Relationship

COMMUNICATION II Moisture Determination of Cocoa Beans by Microwave Oven

> library(sem) > cor.mat<-read.moments(names=c("ten1", "ten2", "ten3", "wor1", "wor2", + "wor3", "irthk1", "irthk2", "irthk3", "body1", "body2",

MAIN FACTORS THAT DETERMINE CONSUMER BEHAVIOR FOR WINE IN THE REGION OF PRIZREN, KOSOVO

Tavi Supriana Program Studi Agribisnis, Fakultas Pertanian Universitas Sumatera Utara

THESIS. Submitted to The Faculty of Agricultural Technology in partial fulfillment of the requirements for obtaining the Bachelor Degree

R Analysis Example Replication C10

Loire Valley vs South Africa : which marketing practices regarding Chenin?

Flexible Imputation of Missing Data

P.U. (A) 200. AKTA LEMBAGA MINYAK SAWIT MALAYSIA Dalam Perintah ini, melainkan jika konteksnya menghendaki makna yang

APLIKASI MUDAH ALIH PEMBELAJARAN KOD DAN ALIHAN KOD GITAR UMI AMIRA BINTI SHARIFFUDIN PROF. MADYA. DR. NORAIDAH ASHAARI

Consumer preferences for organic and welfare labelled meat A natural field experiment conducted in a high class restaurant

Homework 1 - Solutions. Problem 2

Online Appendix to The Effect of Liquidity on Governance

The multivariate piecewise linear growth model for ZHeight and zbmi can be expressed as:

Curtis Miller MATH 3080 Final Project pg. 1. The first question asks for an analysis on car data. The data was collected from the Kelly

Tim Woods Lia Nogueira Shang Ho Yang Xueting Deng WERA 72 Meetings 2014

Protest Campaigns and Movement Success: Desegregating the U.S. South in the Early 1960s

Valuation in the Life Settlements Market

UNIVERSITI PUTRA MALAYSIA FACTORS AFFECTING GLUTEN PRODUCTION AND ITS RHEOLOGICAL CHARACTERIZATIONS DAYANG NORULFAIRUZ BINTI ABANG ZAIDEL FK

DETERMINANTS OF SOYBEAN IMPORT IN INDONESIA

Appendix Table A1 Number of years since deregulation

WARTAKERAJMN PERSEKUTUAN

EFFECTS OF 1-METHYLCYCLOPROPENE (1-MCP) COUPLED WITH CONTROLLED ATMOSPHERE STORAGE ON THE RIPENING AND QUALITY OF CAVENDISH BANANA ABSTRACT

Sistem Kedai Basikal Dalam Talian Techprocycles

SISTEM PENGESAHAN PENGGUNA MENGGUNAKAN KOD QR (ILOGIN)

ONLINE APPENDIX APPENDIX A. DESCRIPTION OF U.S. NON-FARM PRIVATE SECTORS AND INDUSTRIES

COMPARATIVE ANALYSIS OF REPURCHASE INTENTION BASED ON BRAND TRUST AND BRAND COMMITMENT OF STARBUCKS IN MANADO BETWEEN MALE AND FEMALE

DOKUMEN TIDAK TERKAWAL

EKSPERIMENTASI KOMBINASI TEKNIK SULAM DAN CETAK DARIPADA KULIT KAYU TEKALONG UNTUK REKAAN BEG. Anastasia Anak Hyacinth

RELATIVE EFFICIENCY OF ESTIMATES BASED ON PERCENTAGES OF MISSINGNESS USING THREE IMPUTATION NUMBERS IN MULTIPLE IMPUTATION ANALYSIS ABSTRACT

Business Statistics /82 Spring 2011 Booth School of Business The University of Chicago Final Exam

Penyakit Anthracnose pada Cili Di Malaysia: Biologi Patogen dan Varietal Susceptibility

Regression Models for Saffron Yields in Iran

Zeitschrift für Soziologie, Jg., Heft 5, 2015, Online- Anhang

The International Food & Agribusiness Management Association. Budapest, Hungary. June 20-21, 2009

Why PAM Works. An In-Depth Look at Scoring Matrices and Algorithms. Michael Darling Nazareth College. The Origin: Sequence Alignment

From VOC to IPA: This Beer s For You!

Influence of Service Quality, Corporate Image and Perceived Value on Customer Behavioral Responses: CFA and Measurement Model

February 26, The results below are generated from an R script.

MULTIPURPOSE BIO FERTILIZER

Survival of the Fittest: The Impact of Eco-certification on the Performance of German Wineries. Patrizia Fanasch University of Paderborn, Germany

FACTORS AFFECTING CUSTOMER SATISFACTION IN FAST FOOD RESTAURANTS NORAIN BINTI HASSIM UNIVERSITI TEKNIKAL MALAYSIA MELAKA

Effects of political-economic integration and trade liberalization on exports of Italian Quality Wines Produced in Determined Regions (QWPDR)

TEFAL-NoticeFOUR_QUARTZTECH_NC _Mise en page 1 17/05/12 08:40 PageA

USING STRUCTURAL TIME SERIES MODELS For Development of DEMAND FORECASTING FOR ELECTRICITY With Application to Resource Adequacy Analysis

DasarTeknologi Fermentasi. -Introduction of Fermentation Process-

Factors Influence Tea Exports in North Sumatera Province

BORDEAUX WINE VINTAGE QUALITY AND THE WEATHER ECONOMETRIC ANALYSIS

What are the Driving Forces for Arts and Culture Related Activities in Japan?

J. Best 1 A. Tepley 2

Ramalan Naik Turun Minyak Sawit Mentah Menggunakan Rangkaian Neural Buatan. Nur Atiqah Nazari Mohammad Faidzul Nasrudin

Rumah Makan Cibiuk Shah Alam

Wine Rating Prediction

Evaluation of Plant and Animal Tea Solution Fertilizers on the Soil Fertility and Growth of Locust Bean (Parkia clappertonia) Seedlings in the Nursery

SISTEM KAWALAN SEKURITI PINTU MENGGUNAKAN KOD QR MOHD AKMAL HAFIZUDDIN BIN ABDUL LATIFF NORLEYZA JAILANI

THE STATISTICAL SOMMELIER

Kesan Merebus Ke Atas Kandungan Zat Sayuran Kekacang (Effect of Boiling on the Nutrient Contents of Vegetable Legumes)

Transcription:

Model Log-Linear (Bagian 2) Dr. Kusman Sadik, M.Si Program Studi Pascasarjana Departemen Statistika IPB, 2018/2019

When fitting log-linear models to higher-way tables it is typical to only consider models that are hierarchical in nature. These are models that include all lower-order terms for variables involved in higher-order terms in the model. For a three-way contingency table, with variables X, Y, and Z, the saturated model includes all main effects, all two-way interactions and the three-way interaction, and is represented symbolically as follows: 2

Exp( ) merupakan nilai odds antara kategori pada baris ke-i dengan kategori baris terakhir. Exp( ) merupakan nilai rasio odds antara odds kategori pada baris ke-i dengan kategori baris terakhir dengan odds kategori pada kolom ke-j dengan kategori kolom terakhir 3

Lihat : Azen, hlm. 145 4

** Model Log-Linear untuk Data Tabel 7.4 (Azen, hlm.145) ** ** relevel --> Memilih Kategori Referensi ** ** Model 1 : Interaksi XY XZ YZ ** z.gen <- factor(rep(c("1mal","2fem"),each=3, times=3)) x.rel <- factor(rep(c("1lib","2mod","3con"),each=1, times=6)) y.god <- factor(rep(c("1y","2n","3u"),each=6,times=1)) count <- c(26,82,202,44,113,180,121,128,75,221, 204,124,24,52,74,32,49,43) z.gen x.rel y.god <- relevel(z.gen, ref="2fem") <- relevel(x.rel, ref="3con") <- relevel(y.god, ref="3u") data.frame(z.gen, x.rel, y.god, count) model <- glm(count ~ x.rel + y.god + z.gen + x.rel*y.god + x.rel*z.gen + y.god*z.gen, family=poisson("link"=log)) summary(model) dugaan <- round(fitted(model),2) data.frame(z.gen, x.rel, y.god, count, dugaan) 5

z.gen x.rel y.god count 1 1Mal 1Lib 1Y 26 2 1Mal 2Mod 1Y 82 3 1Mal 3Con 1Y 202 4 2Fem 1Lib 1Y 44 5 2Fem 2Mod 1Y 113 6 2Fem 3Con 1Y 180 7 1Mal 1Lib 2N 121 8 1Mal 2Mod 2N 128 9 1Mal 3Con 2N 75 10 2Fem 1Lib 2N 221 11 2Fem 2Mod 2N 204 12 2Fem 3Con 2N 124 13 1Mal 1Lib 3U 24 14 1Mal 2Mod 3U 52 15 1Mal 3Con 3U 74 16 2Fem 1Lib 3U 32 17 2Fem 2Mod 3U 49 18 2Fem 3Con 3U 43 6

Call: glm(formula = count ~ x.rel + y.god + z.gen + x.rel * y.god + x.rel * z.gen + y.god * z.gen, family = poisson(link = log)) Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) 3.862595 0.122713 31.477 < 2e-16 *** x.rel1lib -0.511037 0.177163-2.885 0.003920 ** x.rel2mod 0.005771 0.150379 0.038 0.969388 y.god1y 1.367890 0.134994 10.133 < 2e-16 *** y.god2n 0.860606 0.140582 6.122 9.26e-10 *** z.gen1mal 0.377454 0.136017 2.775 0.005519 ** x.rel1lib:y.god1y -0.994715 0.209026-4.759 1.95e-06 *** x.rel2mod:y.god1y -0.548065 0.162483-3.373 0.000743 *** x.rel1lib:y.god2n 1.212754 0.186792 6.493 8.44e-11 *** x.rel2mod:y.god2n 0.615654 0.163938 3.755 0.000173 *** x.rel1lib:z.gen1mal -0.416543 0.131545-3.167 0.001543 ** x.rel2mod:z.gen1mal -0.272968 0.114568-2.383 0.017191 * y.god1y:z.gen1mal -0.334342 0.146372-2.284 0.022360 * y.god2n:z.gen1mal -0.640833 0.142437-4.499 6.83e-06 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 Null deviance: 724.8365 on 17 degrees of freedom Residual deviance: 6.5154 on 4 degrees of freedom AIC: 146.38 7

z.gen x.rel y.god count dugaan 1 1Mal 1Lib 1Y 26 28.54 2 1Mal 2Mod 1Y 82 86.34 3 1Mal 3Con 1Y 202 195.12 4 2Fem 1Lib 1Y 44 41.46 5 2Fem 2Mod 1Y 113 108.66 6 2Fem 3Con 1Y 180 186.88 7 1Mal 1Lib 2N 121 115.01 8 1Mal 2Mod 2N 128 122.52 9 1Mal 3Con 2N 75 86.47 10 2Fem 1Lib 2N 221 226.99 11 2Fem 2Mod 2N 204 209.48 12 2Fem 3Con 2N 124 112.53 13 1Mal 1Lib 3U 24 27.45 14 1Mal 2Mod 3U 52 53.14 15 1Mal 3Con 3U 74 69.41 16 2Fem 1Lib 3U 32 28.55 17 2Fem 2Mod 3U 49 47.86 18 2Fem 3Con 3U 43 47.59 8

9

10

Odds X=1 Y=1 = P(X=1 Y=1)/P(X=3 Y=1) Odds X=1 Y=3 P(X=1 Y=3)/P(X=3 Y=3) 11

12

To determine whether the three-way interaction term in the saturated model H 1 : 0 13

Call: glm(formula = count ~ x.rel + y.god + z.gen + x.rel * y.god + x.rel * z.gen + y.god * z.gen + x.rel * y.god * z.gen, family = poisson(link = log)) Null deviance: 7.2484e+02 on 17 degrees of freedom Residual deviance: -4.6851e-14 on 0 degrees of freedom AIC: 147.86 14

Call: glm(formula = count ~ x.rel + y.god + z.gen + x.rel * y.god + x.rel * z.gen + y.god * z.gen, family = poisson(link = log)) Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) 3.862595 0.122713 31.477 < 2e-16 *** x.rel1lib -0.511037 0.177163-2.885 0.003920 ** x.rel2mod 0.005771 0.150379 0.038 0.969388 y.god1y 1.367890 0.134994 10.133 < 2e-16 *** y.god2n 0.860606 0.140582 6.122 9.26e-10 *** z.gen1mal 0.377454 0.136017 2.775 0.005519 ** x.rel1lib:y.god1y -0.994715 0.209026-4.759 1.95e-06 *** x.rel2mod:y.god1y -0.548065 0.162483-3.373 0.000743 *** x.rel1lib:y.god2n 1.212754 0.186792 6.493 8.44e-11 *** x.rel2mod:y.god2n 0.615654 0.163938 3.755 0.000173 *** x.rel1lib:z.gen1mal -0.416543 0.131545-3.167 0.001543 ** x.rel2mod:z.gen1mal -0.272968 0.114568-2.383 0.017191 * y.god1y:z.gen1mal -0.334342 0.146372-2.284 0.022360 * y.god2n:z.gen1mal -0.640833 0.142437-4.499 6.83e-06 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 Null deviance: 724.8365 on 17 degrees of freedom Residual deviance: 6.5154 on 4 degrees of freedom AIC: 146.38 15

Call: glm(formula = count ~ x.rel + y.god + z.gen + x.rel * z.gen + y.god * z.gen, family = poisson(link = log)) Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) 3.75190 0.09978 37.601 < 2e-16 *** x.rel1lib -0.15559 0.07905-1.968 0.049035 * x.rel2mod 0.05331 0.07493 0.711 0.476792 y.god1y 0.99980 0.10503 9.519 < 2e-16 *** y.god2n 1.48782 0.09943 14.964 < 2e-16 *** z.gen1mal 0.45511 0.13489 3.374 0.000741 *** x.rel1lib:z.gen1mal -0.56353 0.12225-4.610 4.04e-06 *** x.rel2mod:z.gen1mal -0.34575 0.11081-3.120 0.001808 ** y.god1y:z.gen1mal -0.27386 0.14465-1.893 0.058324. y.god2n:z.gen1mal -0.71771 0.14014-5.121 3.03e-07 *** --- Null deviance: 724.84 on 17 degrees of freedom Residual deviance: 256.75 on 8 degrees of freedom AIC: 388.61 16

Nilai deviance dapat digunakan untuk menguji hipotesis ada tidaknya hubungan suatu variabel dengan variabel lainnya. Misalkan ada tiga variabel X, Y, dan Z. Untuk menguji apakah ada hubungan antara X dengan Y, dapat dilakukan dengan membandingkan nilai deviance model (X, Y, Z, XY, XZ, YZ) dengan nilai deviance model (X, Y, Z, XZ, YZ). Jika dari uji hipotesis tersebut menerima model (X, Y, Z, XY, XZ, YZ) maka dapat disimpulkan bahwa ada hubungan yang signifikan antara X dan Y. 17

Model 1 : Deviance: 6.5154 on 4 degrees of freedom AIC : 146.38 Model 2 : Deviance: 256.75 on 8 degrees of freedom AIC : 388.61 Apa kesimpulan dari uji deviance tersebut? 18

χ 2 (α, db) : qchisq(α, db, lower.tail=false) > qchisq(0.05, 4, lower.tail=false) [1] 9.487729 Jadi χ 2 (α = 0.05, db = 4) = 9.497729 19

20

21

22

23

24

25

1. Gunakan Program R untuk menyelesaikan Problem 7.1 (Azen, hlm.177). 26

27

2. Gunakan Program R untuk menyelesaikan Problem 8.1 (Agresti, hlm. 347). 28

29

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 2 nd. New York: Wiley. 3. Pustaka lain yang relevan. 30

Bisa di-download di kusmansadik.wordpress.com 31

Terima Kasih 32