Lecture 16: Logistic Regression: Goodness of Fit Information Criteria ROC analysis BMTRY 701 Biostatistical Methods II.

Slides:



Advertisements
Similar presentations
Econometric Modeling Through EViews and EXCEL
Advertisements

Lecture 10 F-tests in MLR (continued) Coefficients of Determination BMTRY 701 Biostatistical Methods II.
Brief introduction on Logistic Regression
Logistic Regression Psy 524 Ainsworth.
Discrete Choice Modeling William Greene Stern School of Business IFS at UCL February 11-13, 2004
Logistic Regression.
Chapter 8 – Logistic Regression
Day 6 Model Selection and Multimodel Inference
Receiver Operating Characteristic (ROC) Curves
Lecture 22: Evaluation April 24, 2010.
Logistic Regression Example: Horseshoe Crab Data
1 BINARY CHOICE MODELS: LOGIT ANALYSIS The linear probability model may make the nonsense predictions that an event will occur with probability greater.
Lecture 17: Regression for Case-control Studies BMTRY 701 Biostatistical Methods II.
From last time….. Basic Biostats Topics Summary Statistics –mean, median, mode –standard deviation, standard error Confidence Intervals Hypothesis Tests.
The SSC presented a data set on cervical cancer for analysis. Purpose of the analysis: determine the different attributes (covariates) for predicting relapse.
Statistics II: An Overview of Statistics. Outline for Statistics II Lecture: SPSS Syntax – Some examples. Normal Distribution Curve. Sampling Distribution.
Midterm Review Goodness of Fit and Predictive Accuracy
Darlene Goldstein 29 January 2003 Receiver Operating Characteristic Methodology.
In previous lecture, we dealt with the unboundedness problem of LPM using the logit model. In this lecture, we will consider another alternative, i.e.
Notes on Logistic Regression STAT 4330/8330. Introduction Previously, you learned about odds ratios (OR’s). We now transition and begin discussion of.
Review for Exam 2 Some important themes from Chapters 6-9 Chap. 6. Significance Tests Chap. 7: Comparing Two Groups Chap. 8: Contingency Tables (Categorical.
BINARY CHOICE MODELS: LOGIT ANALYSIS
April 6, 2010 Generalized Linear Models 2010 LISA Short Course Series Mark Seiss, Dept. of Statistics.
Decision Tree Models in Data Mining
Relationships Among Variables
Statistical hypothesis testing – Inferential statistics II. Testing for associations.
Logistic Regression II Simple 2x2 Table (courtesy Hosmer and Lemeshow) Exposure=1Exposure=0 Disease = 1 Disease = 0.
Today Evaluation Measures Accuracy Significance Testing
Aaker, Kumar, Day Ninth Edition Instructor’s Presentation Slides
SPH 247 Statistical Analysis of Laboratory Data May 19, 2015SPH 247 Statistical Analysis of Laboratory Data1.
1 BINARY CHOICE MODELS: PROBIT ANALYSIS In the case of probit analysis, the sigmoid function is the cumulative standardized normal distribution.
Lecture 15: Logistic Regression: Inference and link functions BMTRY 701 Biostatistical Methods II.
7.1 - Motivation Motivation Correlation / Simple Linear Regression Correlation / Simple Linear Regression Extensions of Simple.
Lecture 12 Model Building BMTRY 701 Biostatistical Methods II.
© Department of Statistics 2012 STATS 330 Lecture 25: Slide 1 Stats 330: Lecture 25.
VI. Evaluate Model Fit Basic questions that modelers must address are: How well does the model fit the data? Do changes to a model, such as reparameterization,
Session 10. Applied Regression -- Prof. Juran2 Outline Binary Logistic Regression Why? –Theoretical and practical difficulties in using regular (continuous)
Logistic Regression Database Marketing Instructor: N. Kumar.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
Chapter 2: Logistic Regression 2.1 Likelihood Approach 2.2 Binary Logistic Regression 2.3 Nominal and Ordinal Logistic Regression Models 1.
Lecture 14: Introduction to Logistic Regression BMTRY 701 Biostatistical Methods II.
Three Statistical Issues (1) Observational Study (2) Multiple Comparisons (3) Censoring Definitions.
Lecture 18 Ordinal and Polytomous Logistic Regression BMTRY 701 Biostatistical Methods II.
© Department of Statistics 2012 STATS 330 Lecture 23: Slide 1 Stats 330: Lecture 23.
Lecture 7: Multiple Linear Regression Interpretation with different types of predictors BMTRY 701 Biostatistical Methods II.
Chap 6 Further Inference in the Multiple Regression Model
© Department of Statistics 2012 STATS 330 Lecture 22: Slide 1 Stats 330: Lecture 22.
Marshall University School of Medicine Department of Biochemistry and Microbiology BMS 617 Lecture 11: Models Marshall University Genomics Core Facility.
The dangers of an immediate use of model based methods The chronic bronchitis study: bronc: 0= no 1=yes poll: pollution level cig: cigarettes smokes per.
LOGISTIC REGRESSION Binary dependent variable (pass-fail) Odds ratio: p/(1-p) eg. 1/9 means 1 time in 10 pass, 9 times fail Log-odds ratio: y = ln[p/(1-p)]
Logistic Regression Analysis Gerrit Rooks
Intermediate Applied Statistics STAT 460 Lecture 23, 12/08/2004 Instructor: Aleksandra (Seša) Slavković TA: Wang Yu
Logistic Regression 2 Sociology 8811 Lecture 7 Copyright © 2007 by Evan Schofer Do not copy or distribute without permission.
Jump to first page Inferring Sample Findings to the Population and Testing for Differences.
Nonparametric Statistics
Birthweight (gms) BPDNProp Total BPD (Bronchopulmonary Dysplasia) by birth weight Proportion.
1 BINARY CHOICE MODELS: LOGIT ANALYSIS The linear probability model may make the nonsense predictions that an event will occur with probability greater.
1 COMPARING LINEAR AND LOGARITHMIC SPECIFICATIONS When alternative specifications of a regression model have the same dependent variable, R 2 can be used.
Model Comparison. Assessing alternative models We don’t ask “Is the model right or wrong?” We ask “Do the data support a model more than a competing model?”
Stats Methods at IC Lecture 3: Regression.
CHAPTER 7 Linear Correlation & Regression Methods
Notes on Logistic Regression
Lecture 18 Matched Case Control Studies
Statistics in MSmcDESPOT
Introduction to Logistic Regression
ביצוע רגרסיה לוגיסטית. פרק ה-2
Review for Exam 2 Some important themes from Chapters 6-9
Problems with infinite solutions in logistic regression
Presentation transcript:

Lecture 16: Logistic Regression: Goodness of Fit Information Criteria ROC analysis BMTRY 701 Biostatistical Methods II

Goodness of Fit  A test of how well the model explains the data  Applies to linear models and generalized linear models  How to do it?  It is simply a comparison of the “current” model to a perfect model What would the estimated likelihood function be in a perfect model? What would the estimated log-likelihood function be in a perfect model

Set up as a hypothesis test  Ho: current model  H1: perfect model  Recall the G 2 statistic comparing models: G 2 = Dev(0) - Dev(1)  How many parameters are there in the null model?  How many parameters are there in the perfect model?

Goodness of Fit test  Perfect model: Assumed to be ‘saturated’ in most cases  That is, there is a parameter for each combination of predictors  In our model? that is likely to be close to N due to the number of continuous variables  Define c = number of parameters in saturated model  Deviance goodness of fit: Dev(0)

Goodness of Fit test  Deviance goodness of fit: Dev(0)  If Dev(Ho) < χ 2 (c-p),1- α, conclude H0  If Dev(Ho) > χ 2 (c-p),1- α conclude H1  Why arent we subtracting deviances?

GoF test for Prostate Cancer Model > mreg1 <- glm(cap.inv ~ gleason + log(psa) + vol + factor(dpros), + family=binomial) > mreg0 <- glm(cap.inv ~ gleason + log(psa) + vol, family=binomial) > mreg1 Coefficients: (Intercept) gleason log(psa) vol factor(dpros)2 factor(dpros)3 factor(dpros) Degrees of Freedom: 378 Total (i.e. Null); 372 Residual (1 observation deleted due to missingness) Null Deviance: Residual Deviance: AIC: Test Statistic: ~ χ2( ) Threshold : χ2(373),1-α, = p-value = 0.43

More Goodness of Fit  There are a lot of options!  Deviance GoF is just one Pearson Chi-square Hosmer-Lemeshow etc  Principles, however, are essentially the same  GoF is not that commonly seen in medical research because it is rarely very important

Information Criteria  Information criterion is a measure of the goodness of fit of an estimated statistical model.  It is grounded in the concept of entropy, offers a relative measure of the information lost describes the tradeoff precision and complexity of the model.  An IC is not a test on the model in the sense of hypothesis testing  it is a tool for model selection.  Given a data set, several competing models may be ranked according to their IC  The model with the lowest IC is chosen as the “best”

Information Criteria  IC rewards goodness of fit, but also includes a penalty that is an increasing function of the number of estimated parameters.  This penalty discourages overfitting.overfitting  The IC methodology attempts to find the model that best explains the data with a minimum of free parameters.  More traditional approaches such as LRT start from a null hypothesis. null hypothesis  IC judges a model by how close its fitted values tend to be to the true values.  the AIC value assigned to a model is only meant to rank competing models and tell you which is the best among the given alternatives.

Akaike Information Criteria (AIC) Akaike, Hirotugu (1974). "A new look at the statistical model identification". IEEE Transactions on Automatic Control 19 (6): 716–723.. Bayesian Information Criteria Schwarz, Gideon E. (1978). "Estimating the dimension of a model". Annals of Statistics 6 (2): 461–464.

AIC versus BIC  BIC and AIC are similar  Different penalty for number of parameters  The BIC penalizes free parameters more strongly than does the AIC.  Implications: BIC tends to choose smaller models  The larger the N, the more likely that AIC and BIC will disagree on model selection

Prostate cancer models  We looked at different forms for volume: A: volume as continuous B: volume as binary (detectable vs. undetectable) C: 4 categories of volume D: 3 categories of volume E: linear + squared term for volume

AIC vs. BIC (N=380) p-2logLikAICBIC A: continuous B: binary C: 4 categories D: 3 categories E: quadratic

AIC vs. BIC if N is multiplied by 10 (N=3800) p-2logLikAICBIC A: continuous B: binary C: 4 categories D: 3 categories E: quadratic

ROC curve analysis  Receiver Operating Characteristic Curve Analysis  Traditionally, looks at the sensitivity and specificity of a ‘model’ for predicting an outcome  Question: based on our model, can we accurately predict if a prostate cancer patient has capsular penetration?

ROC curve analysis  Associations between predictors and outcomes is not enough  Need ‘stronger’ relationship  Classic interpretation of sens and spec a binary test and a binary outcome sensitivity = P(test + | true disease) specificity = P(test - |true no disease)  What is test + in our dataset?  What does the model provide for us?

ROC curve analysis

Fitted probabilities  The fitted probabilities are the probability that a NEW patient with the same ‘covariate profile’ will be a “case” (e.g., capsular penetration, disease, etc.)  We select a probability ‘threshold’ to determine whether a patient is defined as a case or not  Some options: high sensitivity (e.g., cancer screens) high specificity (e.g., PPD skin test for TB) maximize the sum of sens and spec

ROC curve. xi: logit capsule i.dpros detected gleason logpsa i.dpros _Idpros_1-4 (naturally coded; _Idpros_1 omitted) Iteration 0: log likelihood = Iteration 1: log likelihood = Iteration 2: log likelihood = Iteration 3: log likelihood = Iteration 4: log likelihood = Logistic regression Number of obs = 379 LR chi2(6) = Prob > chi2 = Log likelihood = Pseudo R2 = capsule | Coef. Std. Err. z P>|z| [95% Conf. Interval] _Idpros_2 | _Idpros_3 | _Idpros_4 | detected | gleason | logpsa | _cons |

ROC curve

How to interpret?  Every point represents a patient(s) in the dataset  Question: if we use that person’s fitted probability as the threshold, what are the sens and spec values?  Empirically driven based on the fitted probabilities  Choosing the threshold: high sens or spec maximize both? the point on ROC curve closest to the upper left corner

AUC of ROC curve  AUC = Area Under the Curve  0.5 < AUC < 1  AUC = 1 if the model is perfect  AUC = 0.50 if the model is no better than chance  “Good” AUC? context specific for some outcomes, there are already good diagnostic measures so AUC would need to be very high for others, if there is very little, even an AUC of 0.70 would be useful.

Utility in model selection  If the goal of the modeling is prediction, AUC can be used to determine the ‘best’ model  A variable may be associated with the outcome, but not add much in terms of prediction  Example: Model 1: gleason + logPSA + detectable + dpros Model 2: gleason + logPSA + detectable Model 3: gleason + logPSA

ROC curve of models 1, 2, and 3

Sensitivity and Specificity  For ‘true’ use, you need to choose a cutoff.  The AUC of the ROC curve tells you about prediction of model  But, not directly translatable into ‘accuracy’ of a given threshold

phat = 0.50 cutoff Logistic model for capsule True Classified | D ~D | Total | | | | Total | | 379 Classified + if predicted Pr(D) >=.5 True D defined as capsule != Sensitivity Pr( +| D) 65.36% Specificity Pr( -|~D) 82.74% Positive predictive value Pr( D| +) 71.94% Negative predictive value Pr(~D| -) 77.92% False + rate for true ~D Pr( +|~D) 17.26% False - rate for true D Pr( -| D) 34.64% False + rate for classified + Pr(~D| +) 28.06% False - rate for classified - Pr( D| -) 22.08% Correctly classified 75.73%

phat = 0.25 cutoff Logistic model for capsule True Classified | D ~D | Total | | | | Total | | 379 Classified + if predicted Pr(D) >=.25 True D defined as capsule != Sensitivity Pr( +| D) 89.54% Specificity Pr( -|~D) 57.52% Positive predictive value Pr( D| +) 58.80% Negative predictive value Pr(~D| -) 89.04% False + rate for true ~D Pr( +|~D) 42.48% False - rate for true D Pr( -| D) 10.46% False + rate for classified + Pr(~D| +) 41.20% False - rate for classified - Pr( D| -) 10.96% Correctly classified 70.45%