Assessing the Calibration of Dichotomous Outcome Models with the Calibration Belt

Similar documents
Assessing Calibration of Logistic Regression Models: Beyond the Hosmer-Lemeshow Goodness-of-Fit Test

Homework Solutions Applied Logistic Regression

Statistical Modelling with Stata: Binary Outcomes

Sociology 362 Data Exercise 6 Logistic Regression 2

7/28/15. Review Homework. Overview. Lecture 6: Logistic Regression Analysis

Binary Dependent Variables

Modelling Binary Outcomes 21/11/2017

Logistic Regression. Building, Interpreting and Assessing the Goodness-of-fit for a logistic regression model

From the help desk: Comparing areas under receiver operating characteristic curves from two or more probit or logit models

Logistic Regression Models for Multinomial and Ordinal Outcomes

ECON Introductory Econometrics. Lecture 11: Binary dependent variables

Lecture 12: Effect modification, and confounding in logistic regression

Introduction to the Logistic Regression Model

A Journey to Latent Class Analysis (LCA)

Logit estimates Number of obs = 5054 Wald chi2(1) = 2.70 Prob > chi2 = Log pseudolikelihood = Pseudo R2 =

Binomial Model. Lecture 10: Introduction to Logistic Regression. Logistic Regression. Binomial Distribution. n independent trials

STAT 7030: Categorical Data Analysis

Lecture 10: Introduction to Logistic Regression

7. Assumes that there is little or no multicollinearity (however, SPSS will not assess this in the [binary] Logistic Regression procedure).

Confidence intervals for the variance component of random-effects linear models

Nonlinear Econometric Analysis (ECO 722) : Homework 2 Answers. (1 θ) if y i = 0. which can be written in an analytically more convenient way as

Description Syntax for predict Menu for predict Options for predict Remarks and examples Methods and formulas References Also see

Understanding the multinomial-poisson transformation

ECON 594: Lecture #6

Lecture 3.1 Basic Logistic LDA

Exercise 7.4 [16 points]

Modelling Rates. Mark Lunt. Arthritis Research UK Epidemiology Unit University of Manchester

Exam ECON3150/4150: Introductory Econometrics. 18 May 2016; 09:00h-12.00h.

Correlation and regression

Logistic Regression: Regression with a Binary Dependent Variable

raise Coef. Std. Err. z P> z [95% Conf. Interval]

STATISTICS 110/201 PRACTICE FINAL EXAM

Case of single exogenous (iv) variable (with single or multiple mediators) iv à med à dv. = β 0. iv i. med i + α 1

Lab 11 - Heteroskedasticity

crreg: A New command for Generalized Continuation Ratio Models

Goodness-of-Fit Tests for the Ordinal Response Models with Misspecified Links

Unit 5 Logistic Regression

Unit 5 Logistic Regression

Introduction to logistic regression

Chapter 11. Regression with a Binary Dependent Variable

Using the same data as before, here is part of the output we get in Stata when we do a logistic regression of Grade on Gpa, Tuce and Psi.

Linear Modelling in Stata Session 6: Further Topics in Linear Modelling

2. We care about proportion for categorical variable, but average for numerical one.

Unit 5 Logistic Regression

Logistic Regression. Fitting the Logistic Regression Model BAL040-A.A.-10-MAJ

options description set confidence level; default is level(95) maximum number of iterations post estimation results

Lecture 2: Poisson and logistic regression

Problem Set #3-Key. wage Coef. Std. Err. t P> t [95% Conf. Interval]

Practice exam questions

Recent Developments in Multilevel Modeling

BIOS 312: MODERN REGRESSION ANALYSIS

Logistic Regression. Continued Psy 524 Ainsworth

Extended regression models using Stata 15

especially with continuous

Analysis of Categorical Data. Nick Jackson University of Southern California Department of Psychology 10/11/2013

Economics 326 Methods of Empirical Research in Economics. Lecture 14: Hypothesis testing in the multiple regression model, Part 2

BIOSTATS Intermediate Biostatistics Spring 2017 Exam 2 (Units 3, 4 & 5) Practice Problems SOLUTIONS

A Running Example: House Voting on NAFTA

Meta-analysis of epidemiological dose-response studies

Lecture 5: Poisson and logistic regression

Statistical Modelling in Stata 5: Linear Models

Marginal Effects for Continuous Variables Richard Williams, University of Notre Dame, Last revised January 20, 2018

LOGISTIC REGRESSION Joseph M. Hilbe

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

mi estimate : regress newrough_ic Current Torch_height Slowoncurves E_0 G_0 Current > 2 Pressure2 Cut_speed2 Presscutspeed, noconstant

Soc 63993, Homework #7 Answer Key: Nonlinear effects/ Intro to path analysis

Consider Table 1 (Note connection to start-stop process).

LOGISTIC REGRESSION. Lalmohan Bhar Indian Agricultural Statistics Research Institute, New Delhi

Stat 642, Lecture notes for 04/12/05 96

Section IX. Introduction to Logistic Regression for binary outcomes. Poisson regression

Working with Stata Inference on the mean

Acknowledgements. Outline. Marie Diener-West. ICTR Leadership / Team INTRODUCTION TO CLINICAL RESEARCH. Introduction to Linear Regression

Unit 5 Logistic Regression Practice Problems

Logistic Regression Models to Integrate Actuarial and Psychological Risk Factors For predicting 5- and 10-Year Sexual and Violent Recidivism Rates

PSC 8185: Multilevel Modeling Fitting Random Coefficient Binary Response Models in Stata

Editor Executive Editor Associate Editors Copyright Statement:

Binary Dependent Variable. Regression with a

Appendix A. Numeric example of Dimick Staiger Estimator and comparison between Dimick-Staiger Estimator and Hierarchical Poisson Estimator

Mixed Models for Longitudinal Binary Outcomes. Don Hedeker Department of Public Health Sciences University of Chicago.

Introductory Econometrics. Lecture 13: Hypothesis testing in the multiple regression model, Part 1

Outline. 1 Association in tables. 2 Logistic regression. 3 Extensions to multinomial, ordinal regression. sociology. 4 Multinomial logistic regression

General Linear Model (Chapter 4)

Calculating Odds Ratios from Probabillities

Propensity Score Matching and Analysis TEXAS EVALUATION NETWORK INSTITUTE AUSTIN, TX NOVEMBER 9, 2018

A procedure to tabulate and plot results after flexible modeling of a quantitative covariate

The Simulation Extrapolation Method for Fitting Generalized Linear Models with Additive Measurement Error

Lecture#12. Instrumental variables regression Causal parameters III

Multilevel Modeling Day 2 Intermediate and Advanced Issues: Multilevel Models as Mixed Models. Jian Wang September 18, 2012

Logistic Regression Analysis

Extensions to the Basic Framework II

Case-control studies

Addition to PGLR Chap 6

Chapter 19: Logistic regression

PubHlth Intermediate Biostatistics Spring 2015 Exam 2 (Units 3, 4 & 5) Study Guide

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

Outline. 1 Introduction. 2 Logistic regression. 3 Margins and graphical representations of effects. 4 Multinomial logistic regression.

BMI 541/699 Lecture 22

Simultaneous Equations Models: what are they and how are they estimated

sociology 362 regression

i (x i x) 2 1 N i x i(y i y) Var(x) = P (x 1 x) Var(x)

Transcription:

Assessing the Calibration of Dichotomous Outcome Models with the Calibration Belt Giovanni Nattino The Ohio Colleges of Medicine Government Resource Center The Ohio State University Stata Conference - July 19, 2018 Giovanni Nattino 1 / 19

Background: Logistic Regression Most popular family of models for binary outcomes (Y = 1 or Y = 0); Models Pr (Y = 1), probability of success or event ; Given predictors X 1,..., X p, the model is logit {Pr (Y = 1)} = β 0 + β 1 X 1 +... + β p X p, where logit(π) = log (π/(1 π)). Does my model fit the data well? Giovanni Nattino 2 / 19

Goodness of Fit of Logistic Regression Models Let ˆπ be the model s estimate of Pr (Y = 1) for a given subject. Two measures of goodness of fit: Discrimination Do subjects with Y = 1 have higher ˆπ than subjects with Y = 0? Evaluated with area under ROC curve. Calibration Does ˆπ estimate Pr (Y = 1) accurately? Giovanni Nattino 3 / 19

An Example: ICU Data. logit sta age can sysgp_4 typ locd Iteration 0: log likelihood = -100.08048 Iteration 1: log likelihood = -70.385527 Iteration 2: log likelihood = -67.395341 Iteration 3: log likelihood = -66.763511 Iteration 4: log likelihood = -66.758491 Iteration 5: log likelihood = -66.758489 Logistic regression Number of obs = 200 LR chi2(5) = 66.64 Prob > chi2 = 0.0000 Log likelihood = -66.758489 Pseudo R2 = 0.3330 sta Coef. Std. Err. z P> z [95% Conf. Interval] age.040628.0128617 3.16 0.002.0154196.0658364 can 2.078751.8295749 2.51 0.012.4528141 3.704688 sysgp_4-1.51115.7204683-2.10 0.036-2.923242 -.0990585 typ 2.906679.9257469 3.14 0.002 1.092248 4.72111 locd 3.965535.9820316 4.04 0.000 2.040788 5.890281 _cons -6.680532 1.320663-5.06 0.000-9.268984-4.09208 Giovanni Nattino 4 / 19

An Example: ICU Data Outcome Predicted Probability Giovanni Nattino 5 / 19

An Example: ICU Data Observed Proportion Predicted Probability Giovanni Nattino 6 / 19

The Hosmer-Lemeshow Test Divide data into G groups (usually, G = 10). For each group, define: O 1g and E 1g : number of observed and expected events (Y = 1). O 0g and E 0g : number of observed and expected non-events (Y = 0). The Hosmer-Lemeshow statistic is: Ĉ = G g=1 [ ] (O 1g E 1g ) 2 + (O 0g E 0g ) 2 E 1g E 0g Under the hypothesis of perfect fit, Ĉ χ2 G 2. Problems: How many groups? Different G, different results. Hosmer Jr, D. W., Lemeshow, S., Sturdivant, R. X. (2013). Applied logistic regression. Giovanni Nattino 7 / 19

The Calibration Curve Let ĝ = logit( π). What about fitting a new model: If α 0 = 0 and α 1 = 1, logit {P (Y = 1)} = α 0 + α 1 ĝ. logit {P (Y = 1)} = 0 + 1 ĝ = ĝ logit {P (Y = 1)} = logit( π) P (Y = 1) = ˆπ If perfect fit, α 0 = 0 and α 1 = 1. Problems: Only for external validation of the model. Why linear relationship? Cox, D. (1958). Two further applications of a model for a method of binary regression. Biometrika. Giovanni Nattino 8 / 19

The Calibration Curve We assume a general polynomial relationship: logit {P (Y = 1)} = α 0 + α 1 ĝ + α 2 ĝ 2 +... + α m ĝ m. m? fixed too low too simplistic; fixed too high estimation of useless parameters; Solution: Forward selection. Giovanni Nattino 9 / 19

Example: ICU Data Selected polynomial is m = 2: logit {P (Y = 1)} = 0.117 + 0.917ĝ 0.076ĝ 2. This defines the calibration curve P (Y = 1) = e0.117+0.917logit(ˆπ) 0.076(logit(ˆπ))2 1 + e 0.117+0.917logit(ˆπ) 0.076(logit(ˆπ))2 Giovanni Nattino 10 / 19

Example: ICU Data Observed Proportion Predicted Probability Giovanni Nattino 11 / 19

A Goodness of Fit Test When m is selected, we can design a goodness of fit test on logit {P (Y = 1)} = α 0 + α 1 ĝ + α 2 ĝ 2 +... + α m ĝ m. If perfect fit: α 1 = 1, α 0 = α 2 =... = α m = 0. A likelihood ratio test can be used to test the hypothesis H 0 : α 1 = 1, α 0 = α 2 =... = α m = 0 The distribution of the statistic must account for the forward selection on the same data. Inverting the test allows to generate a confidence region around the calibration curve: the calibration belt. Nattino, G., Finazzi, S., Bertolini, G. (2016). A new test and graphical tool to assess the goodness of fit of logistic regression models. Statistics in medicine. Giovanni Nattino 12 / 19

Example: ICU Data. calibrationbelt ----------------------------------------------------------- GiViTI Calibration Belt Calibration belt and test for internal validation: the calibration is evaluated on the training sample. Sample size: 200 Polynomial degree: 2 Test statistic: 1.08 p-value: 0.2994 -----------------------------------------------------------. estat gof, group(10) Logistic model for sta, goodness-of-fit test (Table collapsed on quantiles of estimated probabilities) number of observations = 200 number of groups = 10 Hosmer-Lemeshow chi2(8) = 4.00 Prob > chi2 = 0.8570 Nattino, G., Lemeshow, S., Phillips, G., Finazzi, S., Bertolini, G. (2017). Assessing the calibration of dichotomous outcome models with the calibration belt. Stata Journal Giovanni Nattino 13 / 19

Example: ICU Data 1.8 Type of evaluation: internal Polynomial degree: 2 Test statistic: 1.08 p-value: 0.299 n: 200 Observed.6.4.2 0 Confidence Under Over level the bisector the bisector 95% NEVER NEVER Expected Giovanni Nattino 14 / 19

Example 2: Poorly Fitting Model 1.8 Type of evaluation: internal Polynomial degree: 2 Test statistic: 8.06 p-value: 0.005 n: 200 Observed.6.4.2 0 Confidence Under Over level the bisector the bisector 80% 0.02-0.20 0.44-0.59 0.84-0.97 95% 0.02-0.13 NEVER 0.90-0.97 Expected Giovanni Nattino 15 / 19

Example 3: External Validation. calibrationbelt y phat, devel("external") 1.8 Type of evaluation: external Polynomial degree: 1 Test statistic: 11.75 p-value: 0.003 n: 200 Observed.6.4.2 0 Confidence Under Over level the bisector the bisector 80% 0.55-1.00 0.00-0.12 95% 0.63-1.00 0.00-0.02 Expected Giovanni Nattino 16 / 19

Example 3: External Validation. calibrationbelt y phat, clevel1(.99) clevel2(.6) devel("external") 1.8 Type of evaluation: external Polynomial degree: 1 Test statistic: 11.75 p-value: 0.003 n: 200 Observed.6.4.2 0 Confidence Under Over level the bisector the bisector 60% 0.50-1.00 0.00-0.19 99% 0.73-1.00 NEVER Expected Giovanni Nattino 17 / 19

Example 4: Goodness of Fit and Large Samples. calibrationbelt 1.8 Type of evaluation: internal Polynomial degree: 2 Test statistic: 17.32 p-value: <0.001 n: 336266 Observed.6.4.2 0 Confidence Under Over level the bisector the bisector 80% 0.02-0.06 0.09-0.32 0.49-0.96 95% 0.02-0.06 0.10-0.27 0.55-0.96 Expected Giovanni Nattino 18 / 19

Discussion The calibrationbelt command implements the calibration belt and the related test in Stata. Limitation: Assumed polynomial relationship. Advantages: No need of data grouping. Informative tool to spot significance of deviations. Future work: goodness of fit in very large samples. Giovanni Nattino 19 / 19