Presentation is loading. Please wait.

Presentation is loading. Please wait.

Biostatistics Case Studies 2008 Peter D. Christenson Biostatistician Session 6: Classification Trees.

Similar presentations


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

1 Biostatistics Case Studies 2008 Peter D. Christenson Biostatistician http://gcrc.LAbiomed.org/Biostat Session 6: 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.Regression, discriminant analysis - modeling. 2.Cluster analyses - geometric. 3.Trees - partitioning.

5 Overview of Classification Trees General concept, based on subgroupings: 1.Form combinations of subgroups according to High or Low on each characteristic. 2.Find actual IR rates in each subgroup. 3.Combine subgroups that give similar IR rates. 4.Classify as IR if IR rate is large enough. 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.

6 Figure 2 Classify as IRClassify as non-IR

7 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 specific statistical model. Gives p-values (depends on model being correct). Need to use Prob(IR) which is very model- dependent, unlike High/Low categorizations.

8 Trees or Logistic Regression? Logistic: Not originally designed for classifying, but for finding Prob(IR). Requires specification of predictor interrelations, either known or through data examination; thus, not as flexible. Dependent on correct model. Can prove whether predictors are associated with IR. Trees: Designed for classifying. Interrelations not pre-specified, but detected in the analysis. Does not prove associations “beyond reasonable doubt”, as provided in regression.

9 Outline of this Session Use simulated data to: Classify via logistic regression using only one predictor. Classify via trees using one predictor. Show that results are identical. Show how results differ when 2 predictors are used.

10 IR and HOMA Simulated Data: N=2138 with IR rate increasing with HOMA as in actual data in paper. Overall IR rate = 700/2138 = 33%.

11 IR and HOMA: Logistic Fit 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

12 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.

13 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

14 IR and HOMA: 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

15 Using Classification Trees with One Predictor Choose every possible HOMA value and find sensitivity and specificity (as in creating a ROC curve). Assign relative weights to sensitivity and specificity, often equal, as previously. Need cutpoint h so that we classify as: If HOMA > h then classify as IR If HOMA ≤ h then classify as non-IR

16 IR and HOMA: Trees with Other Cutpoints 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%.

17 IR and HOMA: Final, Simple Tree This is exactly the result from the logistic regression, since the logistic function is monotone in HOMA. See next slide. 700/2138 32.7% IR 198/1517 13.1% IR 502/621 80.8% IR HOMA≤4.61HOMA>4.61

18 IR and HOMA: Logistic 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

19 Summary: Classifying IR from HOMA Logistic regression gives Prob(IR) = e u /(1 + e u ), where u= -4.83 + 0.933(HOMA), so Prob(IR) large is equivalent to HOMA large. This is not the case with 2 predictors, as in next slide. One Predictor Same Classification with Trees and Logistic because:

20 % IR 1.%IR increases non-smoothly with both HOMA and BMI. 2.Logistic regression fits a smooth surface to these %s.

21 Classifying IR from HOMA and BMI Logistic regression gives Prob(IR) = e u /(1 + e u ), where u= -6.51 + 0.87(HOMA) + 0.07(BMI), so Prob(IR) ↑s smoothly as 0.87(HOMA) + 0.07(BMI) does. Trees allow different IR rates in (HOMA, BMI) subgroups. Two Predictors Different Classification with Trees and Logistic because:

22 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.

23 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. We now consider the steps and options that need to be specified in a tree analysis.

24 Implausible Biological Conclusions from Trees 27.528.9 3.60 4.65 BMI HOMA IR Non-IR

25 Potential Logistic Modeling Inadequacy Logistic regression Prob(IR) = e u /(1 + e u ), where u= -6.51 + 0.87(HOMA) + 0.07(BMI), so Prob(IR) ↑s smoothly as 0.87(HOMA) + 0.07(BMI) does Data may not be fit well by: Data does follow logistic curve.

26 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.

27 Remaining Slides: Overview of Decisions Needed for Classification Trees

28 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.

29 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.

30 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.

31 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.

32 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.

33 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 2008 Peter D. Christenson Biostatistician Session 6: Classification Trees."

Similar presentations


Ads by Google