Selected Quantitative Methods Lecture 3 (Binomial) Logistic Regression

Vergelijkbare documenten
Logistic regression: binomial (+multinomial, ordered, conditional)

Logistische regressie analyse: een handleiding Inge Sieben 1 Liesbeth Linssen

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Tentamen Statistiek 2 voor TeMa (2S195) op dinsdag , uur.

Inhoud. Data. Analyse van tijd tot event data: van Edward Kaplan & Paul Meier tot David Cox

Verklaring van het beweeggedrag van ouderen door determinanten van. The explanation of the physical activity of elderly by determinants of

Bestaat er een betekenisvol verband tussen het geslacht en het voorkomen van dyslexie? Gebruik de Chi-kwadraattoets voor kruistabellen.

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica Tentamen Statistiek voor T (2S070) op vrijdag 8 oktober 1999, uur De u

Introductie in flowcharts

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

Oplossingen hoofdstuk XI

ANGSTSTOORNISSEN EN HYPOCHONDRIE: DIAGNOSTIEK EN BEHANDELING (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Add the standing fingers to get the tens and multiply the closed fingers to get the units.

TYPE EXAMENVRAGEN VOOR TOEGEPASTE STATISTIEK

Masterclass: advanced statistics. Bianca de Greef Sander van Kuijk Afdeling KEMTA

Oplossingen hoofdstuk 9

mlw stroom 2.1: Statistisch modelleren

MLW -- Toets stroomblok 2.2: Epidemiologie en Biostatistiek

mlw stroom 2.2 Biostatistiek en Epidemiologie College 9: Herhaalde metingen (2) Syllabus Afhankelijke Data Hoofdstuk 4, 5.1, 5.2

Werk in balans. verloop bij verzorgenden en verpleegkundigen. Work in balance. turnover of nurses and health-care workers.

9. Lineaire Regressie en Correlatie

Voorbeeld regressie-analyse

introductie Wilcoxon s rank sum toets Wilcoxon s signed rank toets introductie Wilcoxon s rank sum toets Wilcoxon s signed rank toets

De Relatie tussen Lichamelijke Gezondheid, Veerkracht en Subjectief. Welbevinden bij Inwoners van Serviceflats

Verband tussen twee variabelen

Zowel correlatie als regressie meten statistische samenhang Correlatie: geen oorzakelijk verband verondersteld: X Y

Enkelvoudige lineaire regressie

Online Resource 1. Title: Implementing the flipped classroom: An exploration of study behaviour and student performance

College 2 Enkelvoudige Lineaire Regressie

Hartpatiënten Stoppen met Roken De invloed van eigen effectiviteit, actieplannen en coping plannen op het stoppen met roken

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Tentamen Statistiek 2 voor TeMa (2S195) op dinsdag ,

Denken is Doen? De cognitieve representatie van ziekte als determinant van. zelfmanagementgedrag bij Nederlandse, Turkse en Marokkaanse patiënten

RECEPTEERKUNDE: PRODUCTZORG EN BEREIDING VAN GENEESMIDDELEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Emotionele Arbeid, de Dutch Questionnaire on Emotional Labor en. Bevlogenheid

Invloed van het aantal kinderen op de seksdrive en relatievoorkeur

Tentamen Biostatistiek 1 voor BMT (2DM40), op maandag 5 januari uur

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 8 februari 2010

COGNITIEVE DISSONANTIE EN ROKERS COGNITIVE DISSONANCE AND SMOKERS

Survival Analyse. Help! Statistiek! Survival Analyse: Overzicht. Voorbeeld: Whiplash onderzoek. Voorbeeld: Intensive Care Unit data

Tentamen Biostatistiek 1 voor BMT (2DM40) woensdag 28 oktober 2009, uur

Chapter 4 Understanding Families. In this chapter, you will learn

Bijlage 3: Multiple regressie analyse

Pilot vragenlijst communicatieve redzaamheid

Analyse van kruistabellen

Verschil in Perceptie over Opvoeding tussen Ouders en Adolescenten en Alcoholgebruik van Adolescenten

ALGORITMIEK: answers exercise class 7

Menu aansturing van SPSS voorbeeld in paragraaf 6.5 van hoofdstuk 6 over multipele regressie analyses van recidive bij jongens

Borstkanker: Stichting tegen Kanker (Dutch Edition)

Opgave 1: (zowel 2DM40 als 2S390)

Hoofdstuk 8 Het toetsen van nonparametrische variabelen

10. Moderatie, mediatie en nog meer regressie

Ontpopping. ORGACOM Thuis in het Museum

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Tentamen Statistiek 2 voor TeMa (2S195) op vrijdag , 9-12 uur.

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Examination 2DL04 Friday 16 november 2007, hours.

Communication about Animal Welfare in Danish Agricultural Education

DEEL 1 Probleemstelling 1

Schoolsucces van Friese leerlingen in het voortgezet onderwijs de Boer, Hester

Handleiding Zuludesk Parent

Het Effect van Verschil in Sociale Invloed van Ouders en Vrienden op het Alcoholgebruik van Adolescenten.

DALISOFT. 33. Configuring DALI ballasts with the TDS20620V2 DALI Tool. Connect the TDS20620V2. Start DALISOFT

20. Multilevel lineaire modellen

Meervoudige ANOVA Onderzoeksvraag Voorwaarden

Group work to study a new subject.

De Invloed van Perceived Severity op Condoomgebruik en HIV-Testgedrag. The Influence of Perceived Severity on Condom Use and HIV-Testing Behavior

My Inspiration I got my inspiration from a lamp that I already had made 2 years ago. The lamp is the you can see on the right.

Examenvragen KBM/EMS 09-15

Keuzetwijfels in de Emerging Adulthood rondom Studie- en Partnerkeuze. in Relatie tot Depressie

S e v e n P h o t o s f o r O A S E. K r i j n d e K o n i n g

De Samenhang tussen Dagelijkse Stress, Emotionele Intimiteit en Affect bij Partners met een. Vaste Relatie

Classification of triangles

Preschool Kindergarten

Tentamen Biostatistiek 1 voor BMT (2DM40) woensdag 2 november 2011, uur

Het executief en het sociaal cognitief functioneren bij licht verstandelijk. gehandicapte jeugdigen. Samenhang met emotionele- en gedragsproblemen

1 vorig = omzet voorgaande jaar. Forward (Criterion: Probability-of-F-to-enter <=,050) 2 bezoek = aantal bezoeken vertegenwoordiger

Settings for the C100BRS4 MAC Address Spoofing with cable Internet.

AE1103 Statics. 25 January h h. Answer sheets. Last name and initials:

OUTDOOR HD BULLET IP CAMERA PRODUCT MANUAL

Luister alsjeblieft naar een opname als je de vragen beantwoordt of speel de stukken zelf!

Buy Me FILE 5 BUY ME BK 2

ANOVA in SPSS. Hugo Quené. opleiding Taalwetenschap Universiteit Utrecht Trans 10, 3512 JK Utrecht 12 maart 2003

LinkedIn Profiles and personality

(1) De hoofdfunctie van ons gezelschap is het aanbieden van onderwijs. (2) Ons gezelschap is er om kunsteducatie te verbeteren

MyDHL+ Van Non-Corporate naar Corporate

Exercise P672 Lightweight Structures. A.P.H.W. Habraken. Report

** VOORBEELD VAN CAUSALE ANALYSE MET CONFOUNDER EN MEDIATOR **.. GET FILE='u:\)Research\ISSP-NL\ISSP \Data\issp_2013_2014_NL_def.sav'.

Duurzaam projectmanagement - De nieuwe realiteit van de projectmanager (Dutch Edition)

Wij beloven je te motiveren en verbinden met andere studenten op de fiets, om zo leuk en veilig te fietsen. Benoit Dubois

Regressie-analyse. Cursus Bachelor Project 2 B&O College 2 Harry B.G. Ganzeboom. Regressie-model en mediatie-analyse 1

04/11/2013. Sluitersnelheid: 1/50 sec = 0.02 sec. Frameduur= 2 x sluitersnelheid= 2/50 = 1/25 = 0.04 sec. Framerate= 1/0.

Transcriptie:

Selected Quantitative Lecture 3 (Binomial) Logistic Regression Harry B.G. Ganzeboom VU-FSW Master Social Research September 14-16 2011 SQM 3: Binomial Logistic 1

Wanneer gebruik je logistische regressie? OLS regressie afhankelijke variabele op interval/ratio niveau Logistische regressie wordt gebruikt wanneer de afhankelijke variabele dichotoom is (0-1) Voorspellen van de kans P op een bepaalde gebeurtenis via een kansverhouding [odds] en een logit [log odds]. Verder: veel hetzelfde als bij OLS regressie SQM SQM 3: Review 3: Binomial of Quantitative Logistic RegressionReview of Quantitative 2

Logistic regression We start by studying binomial logistic regression, which relates a binary (0,1) Y-variable to a linear (additive) specification of the X-variables. The changes relative to OLS regression are all in the Y- part: The model is linear in logits. The estimation procedure is entirely different. In particular it is iterative. Variance, sum-of-squares and fit statistics are entirely different from OLS regression. Direct and indirect effects are also complicated. Review SQM of 3: Quantitative Binomial Logistic 3

Various forms The binomial logistic regression is not only frequently used in research practice (any variable can be dichotomized!), but it is also a necessary first step to other, more complicated (and sometimes more informative and more powerful) models for discrete Y-variables. Multinomial logistic regression (Y has more than 2 categories). Ordered logistic regression (Y has more than 2 categories which can be ordered). This model is often used for education as an outcome. Conditional logistic regression (Y has (many) more than 2 categories, which can be scaled on multiple dimensions. This model is very interesting for e.g. political party choice, occupational choice. Review SQM of 3: Quantitative Binomial Logistic 4

Het lineaire probabiliteitsmodel Het is goed mogelijk om de kans P op een bepaalde gebeurtenis te voorspellen met gewone (OLS) regressie: het lineaire probabiliteitsmodel. Dit stuit wel op een aantal problemen: Het kan leiden tot onmogelijke verwachte waarden (< 0 of > 1.0). Dichotome afhankelijke variabelen leiden noodzakelijk tot heteroskedasticiteit, namelijk geringe residuele variantie bij de extremen van de regressielijn. Mede om deze reden kloppen de inferentieel statistische conclusies (standard errors, significantie) niet. Dit is allemaal ernstig bij zeer scheef verdeelde afhankelijke variabelen (gemiddelde / verwachte P dichtbij 1 of 0). Review SQM of 3: Quantitative Binomial Logistic 5

More on OLS for binary Y These often stated reasons to do logistic analysis are in practice not so relevant. Negative expected values are in practice rare, and even if so: so what? OLS significance tests are in practice very close to their logistic counterparts. Do not tell anybody, but I recommend strongly to run an OLS on your problem before you start doing logistic. There is a much better reason to prefer logistic over OLS: logistic regression coefficients are insensitive to marginal distributions. This is very important in practical problems of comparative research (between countries, between periods). Review SQM of 3: Quantitative Binomial Logistic 6

Kansen, kansverhouding, logit 1 Afhankelijke variabele is kans op een gebeurtenis. Kans op categorie 1 is P; kans op categorie 0 is 1-P Kansverhouding (Odds) is P/(1-P). Logit: ln(p/(1-p). Review SQM of 3: Quantitative Binomial Logistic 7

Logaritmes - 1 Logaritme X: tot welke macht moet je een grondtal verheffen om X te verkrijgen. Zie bv.: http://nl.wikipedia.org/wiki/logaritme. Grondtal 10: 10 log(100)=2 Grondtal 2: 2 log(64) = 6. Grondtal e = exp = 2.718: e log(100) = ln(100) = 4.61. Ln(a*b) = ln(a)+ln(b) exp(a+b) = exp(a)*exp(b) Ln(exp(a+b)) = a+b Vermenigvuldigen optellen Delen Aftrekken Machtverheffen vermenigvuldigen of delen Review SQM of 3: Quantitative Binomial Logistic 8

Logaritmes - 2 Ln (2.718) = 1 Ln (2) =.69 Ln (1) = 0 Ln (.5) = -.69 Ln (0) = infinity = undefined Exp(1) = 2.718 Exp(0) = 1 Review SQM of 3: Quantitative Binomial Logistic 9

P versus odds Review SQM of 3: Quantitative Binomial Logistic 10

P odds logit 0.90 9.00 2.20 0.80 4.00 1.39 0.70 2.33 0.85 0.60 1.50 0.41 0.50 1.00 0.00 0.40 0.67-0.41 0.30 0.43-0.85 0.20 0.25-1.39 0.10 0.11-2.20 0.09 0.10-2.31 0.08 0.09-2.44 0.07 0.08-2.59 0.06 0.06-2.75 0.05 0.05-2.94 0.05 0.05-2.94 0.04 0.04-3.18 0.03 0.03-3.48 0.02 0.02-3.89 0.01 0.01-4.60 Review SQM of 3: Quantitative Binomial Logistic 11

P versus Odds Note that for P <.10, P is very close to the odds. P =.05 odds =.05/.95 =.052 P =.10 odds =.10/.90 =.111 But: P =.50 odds =.50/.50 = 1.00 For small effects, the exponentiated coeffients give the same effects on odd and on P. SQM 3: Binomial Logistic 12

P versus logit (ln transformatie) Review SQM of 3: Quantitative Binomial Logistic 13

Logit versus P Review SQM of 3: Quantitative Binomial Logistic 14

Kans, kansverhouding en logits - 2 Logit is de natuurlijke logaritme (ln) van de odds: logit= ln(p/(1-p)) DUS: Omzetten van logits naar odds: exp(logit) odds Omzetten van odds naar logits: ln(odds) logit Omzetten van logit /odds naar P: P = 1 / (1+exp(-logit)) P = odds / (1+odds) These transformations are available in SPSS as predicted value. Review SQM of 3: Quantitative Binomial Logistic 15

Odds and odds-ratio s Many, many people confuse odds and oddsratio. Odds is a ratio of two (complementary) probabilities. Odds-ratio is a ratio of two odds. Odds is a attribute of one variable. Odds-ratio is a relationship between two variables. Review SQM of 3: Quantitative Binomial Logistic 16

Invariance of odds-ratio s Odds ratio s are insensitive to marginal weights. This is of immense importance in casecontrol studies As well as in comparative studies of changes / differences, e.g. voting, occupation, and many other things. Review SQM of 3: Quantitative Binomial Logistic 17

Invariance of odds-ratio s 100 50 0.50 4.00 50 100 2.00 1000 500 0.50 4.00 50 100 2.00 100 500 5.00 4.00 50 1000 20.00 Review SQM of 3: Quantitative Binomial Logistic 18

Studerend in ISSP 2006 (1) Voorbeeld: studerend in ISSP2006. Data voor leeftijd 18-64, N=1575. Gemiddelde is 3.2%, oftewel.032. Student zijn is zeer sterk gedifferentieerd naar leeftijd. Het komt eigenlijk alleen bij jonge mensen voor. OLS Model: STUDENT = 0.239 -.0047 * AGECAT. De slope is zeer significant: t = 12.8. Data worden zeer slecht gerepresenteerd door het lineaire probabiliteitsmodel; verwachte kans op student zijn voor ouderen wordt negatief (-4%). Review SQM of 3: Quantitative Binomial Logistic 19

Studenten in ISSP 2006-2 Logistisch model: Logit(STUDENT) = 5.310 0.269 * AGECAT. Geëxponentieerd: Odds(STUDENT) = exp(5.310 0.269 * AGECAT). Odds(STUDENT) = exp(5.310)*exp(-.269*agecat) In kansen: STUDENT = 1/(1+exp(-logit)) LET OP: T-waarde = 9.3 (anders/kleiner dan bij OLS!) Review SQM of 3: Quantitative Binomial Logistic 20

Studenten in ISSP 2006-3 Observed verwachte waarden AGE N Data OLS LOGIST ODDS LOGIT 19 22 0.682 0.150 0.549 1.219 0.198 22 54 0.389 0.136 0.352 0.544-0.609 30 283 0.032 0.099 0.059 0.063-2.762 40 460 0.007 0.052 0.004 0.004-5.453 50 385 0.005 0.006 0.000 0.000-8.143 60 371 0.000-0.041 0.000 0.000-10.834 Review SQM of 3: Quantitative Binomial Logistic 21

2. Logistische regressie met SPSS Analyze > regression > binary logistic Afhankelijke variabele en onafhankelijke variabelen opgeven (meer mogelijheden dan bij multiple regressie, zelfde als bij UNIANOVA) Logistic Y with X1 X2. [additief, lineair] Logistic Y with X1 X2 C1 /cat=c1. [+ categorisch] Logistic Y with X1 X2 C1 X2*C1 /cat=c1. [+interacties] Review SQM of 3: Quantitative Binomial Logistic 22

Tabel Case Processing Summary Case Processing Summary Unweighted Cases a Selected Cases Included in Analysis Unselected Cases Total a. Missing Cases Total If weight is in effect, see classification table for the total number of cases. N Percent 1575 100.0 0.0 1575 100.0 0.0 1575 100.0 Review SQM of 3: Quantitative Binomial Logistic 23

Tabel Dependent Variable Encoding Dependent Variable Encoding Original Value 0 1 Internal Value 0 1 Review SQM of 3: Quantitative Binomial Logistic 24

Tabel Omnibus Tests of Model coefficients Omnibus Tests of Model Coefficients Step 1 Chi-square df Sig. Step 187.933 1.000 Block 187.933 1.000 Model 187.933 1.000 Review SQM of 3: Quantitative Binomial Logistic 25

Tabel Model Summary Step 1 a. -2 Log likelihood Model Summary Cox & Snell R Square Nagelkerke R Square 255.462 a.112.458 Estimation terminated at iteration number 9 because parameter estimates changed by less than.001. Review SQM of 3: Quantitative Binomial Logistic 26

Tabel Classification Table Classification Table a Predicted Observed Step 1 unempl 0 1 Overall Percentage a. The cut value is.500 unempl 0 1 Percentage Correct 1518 7 99.5 35 15 30.0 97.3 Review SQM of 3: Quantitative Binomial Logistic 27

Een paar handigheden Codeer je afhankelijke variabele altijd zelf 0/1. Bekijk missing values voordat je begint. Logistic kan niets met pairwise. Evt. dus substitutie toepassen. Net zoals bij OLS regressie, is interpretatie eenvoudiger als je X variabelen een 0 bevatten en een gemakkelijke eenheid hebben. Afzonderlijke coefficienten kun je op significantie toetsen met t = b/se. Na enige oefening zijn de exp(b) coefficienten gemakkelijker te interpreteren dan de logistische. Review SQM of 3: Quantitative Binomial Logistic 28

Table Variables in the Equation : Variables in the Equation B S.E. Wald df Sig. Exp(B) Step a 1agecat -.269.029 84.845 1.000.764 Constan 5.310.783 46.034 1.000 202.396 a. Variable(s) entered on step 1: agecat. Review SQM of 3: Quantitative Binomial Logistic 29

Logistische en multiplicatieve regressiecoëfficiënten B geeft de verandering in de logit (=log odds) van de afhankelijke variabele aan bij één eenheid verandering van X. Het model is lineair in de logits. Exp(B) is de multiplicatieve verandering in de odds met een eenheid verandering van X ten opzichte van odds baseline (=multiplicatieve intercept). Exp(B) < 1: afname van odds Exp(B) > 1: toename van odds Bij categorische variabelen kunnen we exp(b) interpreteren als een odds-ratio [OR] = verhouding tussen twee odds. In continuous variables exp(b) denote how much the odds change (multiplicatively), if we move 1 unit of X. Review SQM of 3: Quantitative Binomial Logistic 30

Multiplicatieve coefficienten en de odds-ratio OR Odds = exp (B0 + B1*X1) Odds = exp(b0)*exp(b1*x1) Als X= 0: odds = exp(b0)*exp(0) = exp(b0) Als X=1: odds = exp(b0)*exp(b1) Odds Ratio OR: exp(b0)*exp(b1) / exp(b0) = exp(b1) Review SQM of 3: Quantitative Binomial Logistic 31

Geen gestandaardiseerde B s Anders dan bij OLS heeft logistic geen gestandaardiseerde coefficienten. B s zijn daarom alleen met elkaar vergelijkbaar als hun eenheden vergelijkbaar zijn. Wil je toch gestandaardiseerde coefficienten hebben, dan zul je eerst zelf de X-en moeten standaardiseren (=voorzien van vergelijkbare meeteenheid). Review SQM of 3: Quantitative Binomial Logistic 32

Inferentiele statistiek Logistic geeft niet de bij OLS gebruikelijke T- toets: t = B/SE. Deze kun je wel zelf berekenen. Wald statistic is t 2. Vergelijk met Chi2 of F-tabel met 1, veel vrijheidsgraden. Kritieke waarde: 3.84. SE s behoren horen bij logits. Betrouwbaarheidsintervalllen rondom logits zijn symmetrisch, rondom multiplicatieve coefficienten zijn ze asymmetrisch. Review SQM of 3: Quantitative Binomial Logistic 33

3. Logistische regressie met nominale onafhankelijke variabelen Bij logistic behoef je niet zelf dummy-variabelen aan te maken by categorische X (het mag wel).../cat=x1 /contrast(x1)=indicator(1) geeft aan dat X1 categorisch is en 1 de referentiecategorie is. De output kan behoorlijk verwarrend zijn. Let goed op de Categorical variable codings. De Wald statistic is nu een test op gezamenlijke bijdrage van de dummy-variabelen. Review SQM of 3: Quantitative Binomial Logistic 34

Tabel Categorical variable codings Categorical Variables Codings agecat 19 22 30 40 50 60 Parameter coding Frequency (1) (2) (3) (4) (5) 22.000.000.000.000.000 53 1.000.000.000.000.000 276.000 1.000.000.000.000 453.000.000 1.000.000.000 379.000.000.000 1.000.000 363.000.000.000.000 1.000 Review SQM of 3: Quantitative Binomial Logistic 35

4. Rapporteren van een logistische regressie Resultaten van de logistische regressie zowel weergeven in een tabel als in de tekst In de tekst ook inhoudelijk interpreteren van de resultaten Review SQM of 3: Quantitative Binomial Logistic 36

Tabel x. Logistische regressieanalyse van kerklidmaatschap op leeftijd, sekse, opleiding, urbanisatiegraad en burgerlijke status (N=4059) Sekse Leeftijd Opleiding Urbanisatiegr aad Burgerlijke staat Ongehuwd Gescheiden Verweduwd B S.E. Wald df P Exp(B) Review SQM of 3: Quantitative Binomial Logistic 37

Welke zaken in de tekst vermelden? Nagelkerke R 2 = kwaliteit van het model / samenhang OR = Odds ratio s (% verandering bij eenheidsverandering of verschil tussen twee categorieën) P-waarde = is het effect van de onafhankelijke variabele significant en op welk niveau (p <0,05; p<0,01; p<0,001)? Voorbeeld (OR=0,34 ; p<0,01) SQM 3: Binomial Logistic 38