SPH 247 Statistical Analysis of Laboratory Data May 19, 2015SPH 247 Statistical Analysis of Laboratory Data1.

Slides:



Advertisements
Similar presentations
Classification.. continued. Prediction and Classification Last week we discussed the classification problem.. – Used the Naïve Bayes Method Today..we.
Advertisements

...visualizing classifier performance in R Tobias Sing, Ph.D. (joint work with Oliver Sander) Modeling & Simulation Novartis Pharma AG 3 rd BaselR meeting.
...visualizing classifier performance Tobias Sing Dept. of Modeling & Simulation Novartis Pharma AG Joint work with Oliver Sander (MPI for Informatics,
Statistical Significance and Performance Measures
Learning Algorithm Evaluation
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Other Classification Techniques 1.Nearest Neighbor Classifiers 2.Support Vector Machines.
From the homework: Distribution of DNA fragments generated by Micrococcal nuclease digestion mean(nucs) = bp median(nucs) = 110 bp sd(nucs+ = 17.3.
Receiver Operating Characteristic (ROC) Curves
Lecture 16: Logistic Regression: Goodness of Fit Information Criteria ROC analysis BMTRY 701 Biostatistical Methods II.
What Happens to the Performance of a Diagnostic Test when the Disease Prevalence and the Cut-Point Change? Pathological scores Healthy scores Healthy population.
The University of Texas at Austin, CS 395T, Spring 2008, Prof. William H. Press 1 Computational Statistics with Application to Bioinformatics Prof. William.
Logistic Regression Predicting Dichotomous Data. Predicting a Dichotomy Response variable has only two states: male/female, present/absent, yes/no, etc.
Assessing and Comparing Classification Algorithms Introduction Resampling and Cross Validation Measuring Error Interval Estimation and Hypothesis Testing.
Model Evaluation Metrics for Performance Evaluation
Cost-Sensitive Classifier Evaluation Robert Holte Computing Science Dept. University of Alberta Co-author Chris Drummond IIT, National Research Council,
Tutorial 2 LIU Tengfei 2/19/2009. Contents Introduction TP, FP, ROC Precision, recall Confusion matrix Other performance measures Resource.
Nemours Biomedical Research Statistics April 23, 2009 Tim Bunnell, Ph.D. & Jobayer Hossain, Ph.D. Nemours Bioinformatics Core Facility.
ROC Curve and Classification Matrix for Binary Choice Professor Thomas B. Fomby Department of Economics SMU Dallas, TX February, 2015.
1 Logistic Regression Homework Solutions EPP 245/298 Statistical Analysis of Laboratory Data.
Lucila Ohno-Machado An introduction to calibration and discrimination methods HST951 Medical Decision Support Harvard Medical School Massachusetts Institute.
Virginia Image and Video Analysis Pavement conditions, fighter jets, and psychophysics! a.k.a. “Did you hear that???” Andrea Vaccari.
CSCI 347 / CS 4206: Data Mining Module 06: Evaluation Topic 07: Cost-Sensitive Measures.
BASIC STATISTICS: AN OXYMORON? (With a little EPI thrown in…) URVASHI VAID MD, MS AUG 2012.
1 The Receiver Operating Characteristic (ROC) Curve EPP 245 Statistical Analysis of Laboratory Data.
Evaluation – next steps
© Department of Statistics 2012 STATS 330 Lecture 25: Slide 1 Stats 330: Lecture 25.
Basic statistics 11/09/13.
Logistic Regression Pre-Challenger Relation Between Temperature and Field-Joint O-Ring Failure Dalal, Fowlkes, and Hoadley (1989). “Risk Analysis of the.
Performance measurement. Must be careful what performance metric we use For example, say we have a NN classifier with 1 output unit, and we code ‘1 =
Data Analysis 1 Mark Stamp. Topics  Experimental design o Training set, test set, n-fold cross validation, thresholding, imbalance, etc.  Accuracy o.
Classification Performance Evaluation. How do you know that you have a good classifier? Is a feature contributing to overall performance? Is classifier.
Logistic regression. Analysis of proportion data We know how many times an event occurred, and how many times did not occur. We want to know if these.
MEASURES OF TEST ACCURACY AND ASSOCIATIONS DR ODIFE, U.B SR, EDM DIVISION.
© Department of Statistics 2012 STATS 330 Lecture 20: Slide 1 Stats 330: Lecture 20.
Evaluating Results of Learning Blaž Zupan
Computational Intelligence: Methods and Applications Lecture 16 Model evaluation and ROC Włodzisław Duch Dept. of Informatics, UMK Google: W Duch.
Model Evaluation l Metrics for Performance Evaluation –How to evaluate the performance of a model? l Methods for Performance Evaluation –How to obtain.
A preliminary exploration into the Binomial Logistic Regression Models in R and their potential application Andrew Trant PPS Arctic - Labrador Highlands.
Applied Statistics Week 4 Exercise 3 Tick bites and suspicion of Borrelia Mihaela Frincu
Data Mining Practical Machine Learning Tools and Techniques By I. H. Witten, E. Frank and M. A. Hall Chapter 5: Credibility: Evaluating What’s Been Learned.
Machine Learning Tutorial-2. Recall, Precision, F-measure, Accuracy Ch. 5.
Classification Evaluation. Estimating Future Accuracy Given available data, how can we reliably predict accuracy on future, unseen data? Three basic approaches.
© Department of Statistics 2012 STATS 330 Lecture 22: Slide 1 Stats 330: Lecture 22.
Logistic Regression. Example: Survival of Titanic passengers  We want to know if the probability of survival is higher among children  Outcome (y) =
1 Performance Measures for Machine Learning. 2 Performance Measures Accuracy Weighted (Cost-Sensitive) Accuracy Lift Precision/Recall –F –Break Even Point.
Professor William H. Press, Department of Computer Science, the University of Texas at Austin1 Opinionated in Statistics by Bill Press Lessons #50 Binary.
Laboratory Medicine: Basic QC Concepts M. Desmond Burke, MD.
Evaluating Classifiers Reading: T. Fawcett, An introduction to ROC analysis, Sections 1-4, 7 (linked from class website)An introduction to ROC analysis.
SPH 247 Statistical Analysis of Laboratory Data. Binary Classification Suppose we have two groups for which each case is a member of one or the other,
ROC curve estimation. Index Introduction to ROC ROC curve Area under ROC curve Visualization using ROC curve.
Data Analytics CMIS Short Course part II Day 1 Part 4: ROC Curves Sam Buttrey December 2015.
Evaluating Classifiers. Reading for this topic: T. Fawcett, An introduction to ROC analysis, Sections 1-4, 7 (linked from class website)
R Programming/ Binomial Models Shinichiro Suna. Binomial Models In binomial model, we have one outcome which is binary and a set of explanatory variables.
Canadian Bioinformatics Workshops
Transforming the data Modified from:
Logistic regression.
Evaluating Classifiers
Performance Evaluation 02/15/17
Measuring Success in Prediction
کاربرد آمار در آزمایشگاه
Data Mining Classification: Alternative Techniques
Features & Decision regions
Evaluation and Its Methods
The Receiver Operating Characteristic (ROC) Curve
Figure 1. Table for calculating the accuracy of a diagnostic test.
Model Evaluation and Selection
Evaluation and Its Methods
Evaluation and Its Methods
ECE – Pattern Recognition Lecture 8 – Performance Evaluation
Presentation transcript:

SPH 247 Statistical Analysis of Laboratory Data May 19, 2015SPH 247 Statistical Analysis of Laboratory Data1

Binary Classification Suppose we have two groups for which each case is a member of one or the other, and that we know the correct classification (“truth”). We will call the two groups Disease and Healthy Suppose we have a prediction method that produces a single numerical value, and that small values of that number suggest membership in the Healthy group and large values suggest membership in the Disease group. How can we measure the success of the prediction method? First, consider the case when we have a cutoff that defines which group is predicted. February 12, 2014BST 226 Statistical Methods for Bioinformatics2

DiseaseHealthyTotal Predict DiseaseA (True Positive)B (False Positive)A+B Predict HealthyC (False Negative)D (True Negative)C+D TotalA+CB+DA+B+C+D February 12, 2014BST 226 Statistical Methods for Bioinformatics3 A: True Positive (TP), hit D: True negative (TN), correct rejection B: False positive (FP), false alarm, Type I error C: False negative (FN), miss, Type II error

DiseaseHealthyTotal Predict DiseaseA (True Positive)B (False Positive)A+B Predict HealthyC (False Negative)D (True Negative)C+D TotalA+C (Positive)B+D (Negative)A+B+C+D February 12, 2014BST 226 Statistical Methods for Bioinformatics4 Sensitivity, True Positive Rate (TPR), recall TPR = TP/P = TP/(TP+FN) = A/(A+C) Fraction of those with the Disease that are correctly predicted Specificity (SPC), True Negative Rate SPC = TN/N = TN/(TN+FP) = D/(B+D) Fraction of those Healthy who are correctly predicted Precision, Positive Predictive Value (PPV) PPV = TP/(TP+FP) = A/(A+B) Fraction of those predicted to have the Disease who do have it Negative Predictive value (NPV) NPV = TN/(TN+FN) = D/(C+D) Fraction of those predicted to be healthy who are healthy Fall-out or False Positive Rate (FPR) FPR = FP/N = FP/(FP+TN) = 1 − SPC Fraction of those healthy who are predicted to have the disease False Discovery Rate (FDR) FDR = FP/(TP+FP) = 1 − PPV Fraction of those predicted to have the disease who are healthy Accuracy (ACC) ACC = (TP+TN)/(P+N)

Dependence on Population February 12, 2014BST 226 Statistical Methods for Bioinformatics5 Sensitivity and Specificity depend only on the test, not on the composition of the population, other figures are dependent Sensitivity = fraction of patients with the disease who are predicted to have the disease (p = 0.98). Specificity = fraction of patients who are healthy that are classified as healthy (q = 0.99). If the population is 500 Disease and 500 healthy, then TP = 490, FN = 10, TN = 495, FP = 5 and PPV = 490/( ) = If the population is 100 Disease and 1000 healthy, then TP = 98, FN = 2, TN = 990, FP = 10 and PPV = 98/( ) = If the population is 100 Disease and 10,000 healthy, then TP = 98, FN = 2, TN = 9900, FP = 100 and PPV = 98/( ) =

ROC Curve (Receiver Operating Characteristic) If we pick a cutpoint t, we can assign any case with a predicted value ≤ t to Healthy and the others to Disease. For that value of t, we can compute the number correctly assigned to Disease and the number incorrectly assigned to Disease (true positives and false positives). For t small enough, all will be assigned to Disease and for t large enough all will be assigned to Healthy. The ROC curve is a plot of true positive rate vs. false positive rate. If everyone is classified positive (t = 0), then TPR = TP/(TP+FN) = FP/(FP + 0) = 1 FPR = FP/(FP + TN) = FP/(FP + 0) = 1 If everyone is classified negative (t = 1), then TPR = TP/(TP+FN) = o/(0 + FN) = 0 FPR = FP/(FP + TN) = 0/(0 + TN) = 0 February 12, 2014BST 226 Statistical Methods for Bioinformatics6

February 12, 2014BST 226 Statistical Methods for Bioinformatics7 truth <- rep(0:1,each=50) pred <- c(rnorm(50,10,1),rnorm(50,12,1)) library(ROC) roc.data <- rocdemo.sca(truth,pred) plot1 <- function() { nz <- sum(truth==0) n <- length(truth) plot(density(pred[1:nz]),lwd=2,xlim=c(6,18), main="Generating an ROC Curve") lines(density(pred[(nz+1):n]),col=2,lwd=2) abline(v=10,col=4,lwd=2) abline(v=11,col=4,lwd=2) abline(v=12,col=4,lwd=2) } > plot1() > plot(roc.data) > AUC(roc.data) [1]

February 12, 2014BST 226 Statistical Methods for Bioinformatics8

February 12, 2014BST 226 Statistical Methods for Bioinformatics9

February 12, 2014BST 226 Statistical Methods for Bioinformatics10 We now show the ROC curve for a rare outcome: > truth <- rep(0:1,c(990,10)) > pred <- c(rnorm(990,10,1),rnorm(10,12,1)) > plot(rocdemo.sca(truth,pred)) > AUC(rocdemo.sca(truth,pred)) [1]

February 12, 2014BST 226 Statistical Methods for Bioinformatics11 ROC Curve for Rare Outcome

Statistical Significance and Classification Success It is easier for a variable to be statistically significant than for the classification using that variable to be highly accurate, measured, for example, by the ROC curve. Suppose we have 100 patients, 50 in each group (say disease and control). If the groups are separated by 0.5 times the within group standard deviation, then the p-value for the test of significance will be around 0.01 but the classification will only be 60% correct. February 12, 2014BST 226 Statistical Methods for Bioinformatics12

February 12, 2014BST 226 Statistical Methods for Bioinformatics13

Statistical Significance and Classification Success If the classification is to be correct 95% of the time, then the groups need to be separated by 3.3 times the within group standard deviation, and then the p-value for the test of significance will be around essentially 0. February 12, 2014BST 226 Statistical Methods for Bioinformatics14

February 12, 2014BST 226 Statistical Methods for Bioinformatics15

February 12, 2014BST 226 Statistical Methods for Bioinformatics16 > truth <- rep(0:1,c(80,20)) > summary(glm(truth~var1,family=binomial)) Call: glm(formula = truth ~ var1, family = binomial) Deviance Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) e-07 *** var e-06 *** --- Signif. codes: 0 ‘***’ ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: on 99 degrees of freedom Residual deviance: on 98 degrees of freedom AIC: Number of Fisher Scoring iterations: 6

February 12, 2014BST 226 Statistical Methods for Bioinformatics17 > pred2 <- predict(glm(truth~var1,family=binomial),type="response") > table(truth,pred2 >.5) truth FALSE TRUE TPR = 11/20 = 0.55 SPC = TNR = 75/80 = PPV = 11/16 = NPV = 75/84 = FPR = 5/80 = FDR = 5/16 = > source(" > biocLite("ROC") > library(ROC) > plot(rocdemo.sca(truth,pred2)) > abline(v=0.0625,lwd=2) > abline(h=0.55,lwd=2)

February 12, 2014BST 226 Statistical Methods for Bioinformatics18

Choosing a Cutoff Suppose that missing a disease case has an implicit cost of $1000 and a false diagnosis of disease has an implicit cost of $200. Then the cost of the procedure is 1000×FN+200×FP. With a cut-off of 0.5, the estimated cost would be (1000)(9) + (200)(5) = $10,000 per 100 patients or $100 per patient. Let’s compute the cost for different cutoffs. February 12, 2014BST 226 Statistical Methods for Bioinformatics19

February 12, 2014BST 226 Statistical Methods for Bioinformatics20 diagcost <- function(truth,predq,costp,costn) { n <- length(predq) names(predq) <- "" cutoffs <- c(sort(predq),1) fpvec <- rep(0,n+1) fnvec <- rep(0,n+1) costvec <- rep(0,n+1) for (i in 1:(n+1)) { predb = cutoffs[i] fp <- sum(predb & !truth) fn <- sum(!predb & truth) cost <- fp*costp+fn*costn fpvec[i] <- fp fnvec[i] <- fn costvec[i] <- cost } return(data.frame(1:(n+1),cutoffs,fpvec,fnvec,costvec)) } The least cost of $4200 (vs. $10,000) is at cutoff = with 1 false negative and 16 false positives The cutoff of minimizes the total errors with 2 false positives and 9 false negatives (cost $9400)

February 12, 2014BST 226 Statistical Methods for Bioinformatics21

February 12, 2014BST 226 Statistical Methods for Bioinformatics22