Presentation is loading. Please wait.

Presentation is loading. Please wait.

Biostatistics Case Studies 2009 Peter D. Christenson Biostatistician Session 1: Classification Trees.

Similar presentations


Presentation on theme: "Biostatistics Case Studies 2009 Peter D. Christenson Biostatistician Session 1: Classification Trees."— Presentation transcript:

1 Biostatistics Case Studies 2009 Peter D. Christenson Biostatistician http://gcrc.labiomed.org/biostat Session 1: Classification Trees

2 Case Study Goal of paper: Classify subjects as IR or non-IR using subject characteristics other than definitive IR such as clamp: Gender, weight, lean body mass, BMI, waist and hip circumferences, LDL, HDL, Total Chol, triglycerides, FFA, DBP, SBP, fasting insulin and glucose, HOMA, family history of diabetes, and some derived ratios from these.

3 Major Conclusion Using All Predictors 27.528.9 3.60 4.65 BMI HOMA IR Non-IR p 336, 1st column:

4 Broad Approaches to Classification 1.Cluster analyses – geometric. 2.Regression, discriminant analysis – modeling. 3.Trees – subgroup partitioning.

5 Classification Tree Steps There are several flavors of tree methods, each with many options, but most involve: Specifying criteria for predictive accuracy. Tree building. Tree building stopping rules. Pruning. Cross-validation.

6 Overview of Classification Trees General concept, based on subgroupings: 1.Form subgroups according to combinations of characteristics, each split as High or Low. 2.The splits and selection of variables are determined from IR rates in each subgroup. 3.Classify each subgroup as IR or not. Notes: 1.No model or statistical assumptions. 2.And so no p-values. 3.Many options are involved in grouping details. 4.Actually implemented hierarchically – next slide.

7 Figure 2 Classify as IRClassify as non-IR =81%=13%

8 Subgroups Combined as IR or Not 27.528.9 3.60 4.65 BMI HOMA Subgroups 6 7 8 IR Non IR Subgroup 1 Subgroup 2 Sub group 3 Subgroup 4 Subgroup 5 3.11 Graphical Representation of Figure 2:

9 Example of Finding Optimal Subgroups Overall IR rate = 700/2138 = 33%. Simulated Data: Split at 3.5: IR rates are ~ 0.4 vs. 0.1 → 4-fold Split at 4.0: IR rates are ~ 0.6 vs. 0.12 → 5-fold Split at 7.0: IR rates are ~ 0.8 vs. 0.4 → 2-fold Choose HOMA that maximizes fold diff. Then repeat for all other variables. Then choose max fold variable.

10 Criteria for Optimal Splitting The relative rates – fold or difference – as in the previous slide could be used. For classification, sensitivities and specificities may be used since they describe misclassifications.

11 Classification Tree with One Predictor Choose every possible HOMA value and find sensitivity and specificity (as in creating a ROC curve). Assign weights to the relative importance of sensitivity and specificity, often equal or AUC. Using, find cutpoint h so that we decide: If HOMA > h then classify as IR If HOMA ≤ h then classify as non-IR

12 Classification Accuracies by Cutpoints From SAS (“Event” = IR): --Correct-- --Incorrect-- ---------- Percentages ------------- HOMA Non- Non- Sensi- Speci- False False Level Event Event Event Event Correct tivity ficity POS NEG 3.5 588 1117 321 112 79.7 84.0 77.7 35.3 9.1 4.0 542 1237 201 158 83.2 77.4 86.0 27.1 11.3 4.5 506 1302 136 194 84.6 72.3 90.5 21.2 13.0 5.0 458 1333 105 242 83.8 65.4 92.7 18.7 15.4 5.5 400 1350 88 300 81.9 57.1 93.9 18.0 18.2 6.0 338 1363 75 362 79.6 48.3 94.8 18.2 21.0 6.5 286 1369 69 414 77.4 40.9 95.2 19.4 23.2 7.0 233 1390 48 467 75.9 33.3 96.7 17.1 25.1 7.5 174 1403 35 526 73.8 24.9 97.6 16.7 27.3 8.0 123 1416 22 577 72.0 17.6 98.5 15.2 29.0 8.5 60 1428 10 640 69.6 8.6 99.3 14.3 30.9 9.0 0 1438 0 700 67.3 0.0 100.0. 32.7 If the overall percentage correct is used to choose the “optimal” cutpoint, then cutpoint=4.61, with % correct=85.2%, sensitivity=71.7% and specificity=91.7%. 4.6185.291.771.7502198

13 Final Tree if Only One Variable Numbers are slightly different than the paper due to my simulating the real data. 700/2138 32.7% IR 198/1517 13.1% IR 502/621 80.8% IR HOMA≤4.61HOMA>4.61 Using 4.61 minimizes the percentage misclassified. Is it OK to find a p-value for 13% vs. 81% with a chi- square or Fisher’s exact test?

14 Now Repeat for Each of These 2 Subgroups: Classify as IRClassify as non-IR =81%=13%

15 Trees: Major Decisions to Make “Difference” measure: fold diff or misclassify rate? “Depth” of tree: when to stop? Which subgroups to combine.

16 Alternative More Standard Analysis: Logistic Regression

17 Alternative: Logistic Regression 1. Find equation: Prob(IR) = function(w 1 *BMI + w 2 *HOMA + w 3 *LDL +...) where the w’s are weights (coefficients). 2.Classify as IR if Prob(IR) is large enough. Note: Assumes functional specification (“model”). Gives p-values (which depend on model being correct). Find a Prob(IR) cutoff to satisfy desired tradeoffs between sensitivity and specificity.

18 Logistic Regression with Only One Predictor Fitted logistic model predicts probability of IR as: Prob(IR) = e u /(1 + e u ), where u= -4.83 + 0.933(HOMA) A logistic curve has this sigmoidal shape Simulated Data:

19 Using Logistic Model for Classification The logistic model proves that the risk of IR ↑ as HOMA ↑ (significance of the coefficient 0.933 is p<0.0001). How can we classify as IR or not based on HOMA? Use Prob(IR). –Need cutpoint c so that we classify as: If Prob(IR) > c then classify as IR If Prob(IR) ≤ c then classify as non-IR Regression does not supply c. It is chosen to balance sensitivity and specificity.

20 IR and HOMA: Logistic with Arbitrary Cutpoint If cutpoint c=0.50 is chosen, then we have: Sensitivity = 440/(440+260) = 62.9% Specificity = 1339/(1339+99) = 93.1% Assign IR Assign non-IR Actual IR: N=440 Non-IR: N=99 Actual IR: N=260 Non-IR: N=1339

21 Logistic with Other Cutpoints From SAS (“Event” = IR): Classification Table --Correct--- -Incorrect-- ------------ Percentages ------------ Prob Non- Non- Sensi- Speci- False False Level Event Event Event Event Correct tivity ficity POS NEG 0.100 700 0 1438 0 32.7 100.0 0.0 67.3. 0.200 567 1181 257 133 81.8 81.0 82.1 31.2 10.1 0.300 521 1277 161 179 84.1 74.4 88.8 23.6 12.3 0.400 485 1325 113 215 84.7 69.3 92.1 18.9 14.0 0.500 440 1339 99 260 83.2 62.9 93.1 18.4 16.3 0.600 386 1354 84 314 81.4 55.1 94.2 17.9 18.8 0.700 331 1363 75 369 79.2 47.3 94.8 18.5 21.3 0.800 272 1376 62 428 77.1 38.9 95.7 18.6 23.7 0.900 171 1404 34 529 73.7 24.4 97.6 16.6 27.4 Often, the overall percentage correct is used to choose the “optimal” cutpoint. Here, that gives cutpoint=0.37, with % correct=85.2%, sensitivity=71.7% and specificity=91.7%. 0.3785.291.771.7 Data that is used to create a ROC

22 One Predictor: Logistic is Equivalent to Tree Assign IR Assign non-IR Actual IR: N=502 Non-IR: N=119 Actual IR: N=198 Non-IR: N=1319 Assign IRAssign non-IR Actual IR: N=502 Non-IR: N=119 Actual IR: N=198 Non-IR: N=1319 But no proof or p-value from tree. Prob(IR) = e u /(1 + e u ), where u= -4.83 + 0.933(HOMA) So Prob(IR) ↑ as HOMA ↑ (monotonic)

23 Summary: One Predictor Logistic regression and tree give same conclusion. Regression can prove predictor-outcome association by providing p-value. This proof depends on “smooth” equation. Can verify data follows this smooth relation. Tree: No p-value, but can validate on other data.

24 More Than One Predictor

25 % IR 1.%IR may increase non-smoothly with HOMA and BMI. 2.Logistic regression fits a smooth surface to these %s.

26 Classifying IR from HOMA and BMI: Logistic 27.528.9 3.60 4.65 BMI HOMA Non-IR IR Equation: 0.87(HOMA) + 0.07(BMI) = cutpoint Logistic regression forces a smooth partition such as the following, although adding HOMA-BMI interaction could give curvature to the demarcation line. Compare this to the tree partitioning on the next slide.

27 Classifying IR from HOMA and BMI: Trees 27.528.9 3.60 4.65 BMI HOMA IR Non-IR Trees partition HOMA-BMI combinations into subgroups, some of which are then combined as IR and non-IR.

28 Disadvantage of Trees 27.528.9 3.60 4.65 BMI HOMA IR Non-IR Can Obtain Implausible Biological Conclusions

29 Potential Modeling Inadequacy Prob(IR) = e u /(1 + e u ), where u= -6.51 + 0.87(HOMA) + 0.07(BMI), unless Prob(IR) ↑s smoothly as 0.87(HOMA) + 0.07(BMI) does Data may not follow logistic curve: Data does follow logistic curve. Disadvantage of Regression

30 Use Trees or Logistic Regression? Logistic: Requires specification of smooth function and any interrelations among predictors. Gives a probabilistic statement (p-value) about the generalizability of whether predictors are associated with IR – “proof”. P-value somewhat dependent on correct specification. Both technical and heuristic ways to check specifications.

31 Use Trees or Logistic Regression? Trees: Interrelations not pre-specified, but detected in the analysis. Does not prove associations beyond reasonable doubt – i.e., no traditional “proof”. Conclusions may be very specific to data in the sample. With enough subjects, can generate trees from some subjects and validate in others. Provides credibility as in replicated experiments.

32 Validation in Paper Appendix ? CVIR Prediction Rule Area ROC (%) Sensitivity (%) Specificity (%) 1 (HOMA-IR > 4.65) or (BMI > 34.8) or (BMI > 27.5 & LDL < 4.77) 87.0282.7271.43 2(HOMA-IR > 4.49) or (BMI > 28.1 & LDL < 4.94)87.0581.8274.32 3 (HOMA-IR > 7.36) or (BMI > 28.1) or (HOMA-IR > 4.49 & (BMI > 23.5 or LDL > 3.26)) 89.7988.4170.34 4 (HOMA-IR > 7.40) or (BMI > 27.5 & LDL 4.49 & (BMI > 23.8 or LDL > 3.22)) 88.5782.5473.51 5(HOMA-IR > 3.09)90.5485.0773.47 6(HOMA-IR > 3.00)87.9080.2874.13 7(HOMA-IR > 4.49) or (BMI > 28.4 & LDL < 4.91)84.8975.0078.08 8 (HOMA-IR > 4.65) or (BMI > 28.7) or (HOMA-IR > 3.11 & LDL < 2.85) 89.6178.0883.69 9 (HOMA-IR > 4.66) or (BMI > 28.5) or (HOMA-IR > 3.11 & LDL < 2.49) 89.0585.3778.63 10(HOMA-IR > 3.00) or (BMI > 34.6)92.6896.6767.32

33 Use Trees or Logistic Regression? Generally: Small N: Cannot use trees. Large N: Trees useful if there are unknown but suspected complex interrelations among predictors. Pre-specifying criteria and validation are critical.

34 Classification Tree Software CART from www.salford-systems.com. Statistica from www.statsoft.com. SAS: in the Enterprise Miner module. SPSS: Has Salford CART in their Clementine Data Mining module.

35 Open Question Isn’t this paper really: Glucose Disposal < 28 µmol/min/kg How could glucose disposal itself be used as the outcome?

36 Use Trees or Logistic Regression? Generally: Small N: cannot use trees. Large N: Trees useful if unknown but suspected complex interrelations among predictors. Pre-specifying criteria and validation are critical.

37 Remaining Slides: Overview of Decision Details Needed for Classification Trees Appendix

38 Classification Tree Steps There are several flavors of tree methods, each with many options, but most involve: Specifying criteria for predictive accuracy. Tree building. Tree building stopping rules. Pruning. Cross-validation.

39 Specifying criteria for predictive accuracy Misclassification cost generalizes the concept of misclassification rates so that some types of misclassifying are given greater weight. Relative weights, or costs are assigned to each type of misclassification. A prior probability of each outcome is specified usually as the observed prevalence of outcome in the data, but could be from previous research or for other populations. The costs and priors together give the criteria for balancing specificity and sensitivity. Observed prevalence and equal weights → minimizing overall misclassification.

40 Tree Building Recursively apply what we did for HOMA for each of the two resulting partitions, then for the next set, etc. Every factor is screened at every step. The same factor may be reused. Some algorithms allow certain linear combinations of factors (e.g., as logistic regression provides, called discriminant functions) to be screened. An “impurity measure” or “splitting function” specifies the criteria for measuring how different two potential new subgroups are. Some choices are “Gini”, chi-square and G-square.

41 Tree Building Stopping Rules It is possible to continue splitting and building a tree until all subgroups are “pure” with only one type of outcome. This may be too fine to be useful. One alternative is “minimum N”, to allow only pure or only subgroups of a minimum size. Another choice is “Fraction of objects” in which a minimum fraction of an outcome class, or a pure class is obtained.

42 Tree Pruning Pruning tries to solve the problem of lack of generalizability due to over-fitting the results to the data at hand. Start at the latest splits and measure the magnitude of the reduced misclassification due to that split. Remove the split if it is not large. How large is “not large”. This can be made at least objective, if not foolproof, by a complexity parameter related to the depth of the tree, i.e. number of levels of splits. Combining that with the misclassification cost function gives a “cost- complexity pruning”, used in this paper.

43 Cross Validation At least two data sets are used. The decision rule is built with training set(s), and applied to test set(s). If the misclassification costs for the test sets are similar to that for the training sets, then that decision rule is considered “validated”. With large datasets, as in business data mining, only one training and one test set is used. For smaller datasets, “v-fold cross-validation” is used. The data is randomly split into v sets. Each set serves as the test set once, with the combined remaining v-1 sets as the training set, and v-1 times as part of the training set, for v analyses. Average cost is compared to that for the entire set.


Download ppt "Biostatistics Case Studies 2009 Peter D. Christenson Biostatistician Session 1: Classification Trees."

Similar presentations


Ads by Google