R Under development (unstable) (2024-08-16 r87026 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > suppressWarnings(RNGversion("3.5.2")) > > set.seed(290875) > > datLB <- + structure(list(Site = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, + 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, + 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, + 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, + 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, + 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, + 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, + 9L, 9L, 9L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, + 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, + 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, + 4L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, + 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L,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, 3L, 2L, 1L, 3L, 2L, 3L, 1L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, + 3L, 2L, 1L, 1L, 3L, 2L, 3L, 1L, 1L, 3L, 2L, 1L, 2L, 3L, 3L, 1L, + 2L, 2L, 1L, 3L, 2L, 3L, 1L, 3L, 1L, 2L, 1L, 2L, 3L, 2L, 3L, 1L, + 3L, 1L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 3L, 1L, 2L, 2L, 1L, 3L, 1L, + 2L, 3L, 3L, 1L, 2L, 3L, 2L, 1L, 2L, 1L, 3L, 1L, 1L, 3L, 2L, 3L, + 2L, 1L, 3L, 2L, 1L, 1L, 2L), .Label = c("10000U", "5000U", "Placebo" + ), class = "factor"), Age = c(65L, 70L, 64L, 59L, 76L, 59L, 72L, + 40L, 52L, 47L, 57L, 47L, 70L, 49L, 59L, 64L, 45L, 66L, 49L, 54L, + 47L, 31L, 53L, 61L, 40L, 67L, 54L, 41L, 66L, 68L, 41L, 77L, 41L, + 56L, 46L, 46L, 47L, 35L, 58L, 62L, 73L, 52L, 53L, 69L, 55L, 52L, + 51L, 56L, 65L, 35L, 43L, 61L, 43L, 64L, 57L, 60L, 44L, 41L, 51L, + 57L, 42L, 48L, 57L, 39L, 67L, 39L, 69L, 54L, 67L, 58L, 72L, 65L, + 68L, 75L, 26L, 36L, 72L, 54L, 64L, 39L, 54L, 48L, 83L, 74L, 41L, + 65L, 79L, 63L, 63L, 34L, 42L, 57L, 68L, 51L, 51L, 61L, 42L, 73L, + 57L, 59L, 57L, 68L, 55L, 46L, 79L, 43L, 50L, 39L, 57L, 65L, 70L, + 64L, 59L, 76L, 59L, 72L, 40L, 52L, 47L, 57L, 47L, 70L, 49L, 59L, + 64L, 45L, 66L, 49L, 54L, 47L, 31L, 53L, 61L, 40L, 67L, 54L, 41L, + 66L, 68L, 41L, 77L, 41L, 56L, 46L, 46L, 47L, 35L, 58L, 62L, 73L, + 52L, 53L, 69L, 55L, 52L, 51L, 56L, 65L, 35L, 43L, 61L, 43L, 64L, + 57L, 60L, 44L, 41L, 51L, 57L, 42L, 48L, 57L, 39L, 67L, 39L, 69L, + 54L, 67L, 58L, 72L, 65L, 68L, 75L, 26L, 36L, 72L, 54L, 64L, 39L, + 54L, 48L, 83L, 74L, 41L, 65L, 79L, 63L, 63L, 34L, 42L, 57L, 68L, + 51L, 51L, 61L, 42L, 73L, 57L, 59L, 57L, 68L, 55L, 46L, 79L, 43L, + 50L, 39L, 57L, 65L, 70L, 64L, 59L, 76L, 59L, 72L, 40L, 52L, 47L, + 57L, 47L, 70L, 49L, 59L, 64L, 45L, 66L, 49L, 54L, 47L, 31L, 53L, + 61L, 40L, 67L, 54L, 41L, 66L, 68L, 41L, 77L, 41L, 56L, 46L, 46L, + 47L, 35L, 58L, 62L, 73L, 52L, 53L, 69L, 55L, 52L, 51L, 56L, 65L, + 35L, 43L, 61L, 43L, 64L, 57L, 60L, 44L, 41L, 51L, 57L, 42L, 48L, + 57L, 39L, 67L, 39L, 69L, 54L, 67L, 58L, 72L, 65L, 68L, 75L, 26L, + 36L, 72L, 54L, 64L, 39L, 54L, 48L, 83L, 74L, 41L, 65L, 79L, 63L, + 63L, 34L, 42L, 57L, 68L, 51L, 51L, 61L, 42L, 73L, 57L, 59L, 57L, + 68L, 55L, 46L, 79L, 43L, 50L, 39L, 57L, 65L, 70L, 64L, 59L, 76L, + 59L, 72L, 40L, 52L, 47L, 57L, 47L, 70L, 49L, 59L, 64L, 45L, 66L, + 49L, 54L, 47L, 31L, 53L, 61L, 40L, 67L, 54L, 41L, 66L, 68L, 41L, + 77L, 41L, 56L, 46L, 46L, 47L, 35L, 58L, 62L, 73L, 52L, 53L, 69L, + 55L, 52L, 51L, 56L, 65L, 35L, 43L, 61L, 43L, 64L, 57L, 60L, 44L, + 41L, 51L, 57L, 42L, 48L, 57L, 39L, 67L, 39L, 69L, 54L, 67L, 58L, + 72L, 65L, 68L, 75L, 26L, 36L, 72L, 54L, 64L, 39L, 54L, 48L, 83L, + 74L, 41L, 65L, 79L, 63L, 63L, 34L, 42L, 57L, 68L, 51L, 51L, 61L, + 42L, 73L, 57L, 59L, 57L, 68L, 55L, 46L, 79L, 43L, 50L, 39L, 57L, + 65L, 70L, 64L, 59L, 76L, 59L, 72L, 40L, 52L, 47L, 57L, 47L, 70L, + 49L, 59L, 64L, 45L, 66L, 49L, 54L, 47L, 31L, 53L, 61L, 40L, 67L, + 54L, 41L, 66L, 68L, 41L, 77L, 41L, 56L, 46L, 46L, 47L, 35L, 58L, + 62L, 73L, 52L, 53L, 69L, 55L, 52L, 51L, 56L, 65L, 35L, 43L, 61L, + 43L, 64L, 57L, 60L, 44L, 41L, 51L, 57L, 42L, 48L, 57L, 39L, 67L, + 39L, 69L, 54L, 67L, 58L, 72L, 65L, 68L, 75L, 26L, 36L, 72L, 54L, + 64L, 39L, 54L, 48L, 83L, 74L, 41L, 65L, 79L, 63L, 63L, 34L, 42L, + 57L, 68L, 51L, 51L, 61L, 42L, 73L, 57L, 59L, 57L, 68L, 55L, 46L, + 79L, 43L, 50L, 39L, 57L), W0 = c(32L, 60L, 44L, 53L, 53L, 49L, + 42L, 34L, 41L, 27L, 48L, 34L, 49L, 46L, 56L, 59L, 62L, 50L, 42L, + 53L, 67L, 44L, 65L, 56L, 30L, 47L, 50L, 34L, 39L, 43L, 46L, 52L, + 38L, 33L, 28L, 34L, 39L, 29L, 52L, 52L, 54L, 52L, 47L, 44L, 42L, + 42L, 44L, 60L, 60L, 50L, 38L, 44L, 54L, 54L, 56L, 51L, 53L, 36L, + 59L, 49L, 50L, 46L, 55L, 46L, 34L, 57L, 41L, 49L, 42L, 31L, 50L, + 35L, 38L, 53L, 42L, 53L, 46L, 50L, 43L, 46L, 41L, 33L, 36L, 33L, + 37L, 24L, 42L, 30L, 42L, 49L, 58L, 26L, 37L, 40L, 33L, 41L, 46L, + 40L, 40L, 61L, 35L, 58L, 49L, 52L, 45L, 67L, 57L, 63L, 53L, 32L, + 60L, 44L, 53L, 53L, 49L, 42L, 34L, 41L, 27L, 48L, 34L, 49L, 46L, + 56L, 59L, 62L, 50L, 42L, 53L, 67L, 44L, 65L, 56L, 30L, 47L, 50L, + 34L, 39L, 43L, 46L, 52L, 38L, 33L, 28L, 34L, 39L, 29L, 52L, 52L, + 54L, 52L, 47L, 44L, 42L, 42L, 44L, 60L, 60L, 50L, 38L, 44L, 54L, + 54L, 56L, 51L, 53L, 36L, 59L, 49L, 50L, 46L, 55L, 46L, 34L, 57L, + 41L, 49L, 42L, 31L, 50L, 35L, 38L, 53L, 42L, 53L, 46L, 50L, 43L, + 46L, 41L, 33L, 36L, 33L, 37L, 24L, 42L, 30L, 42L, 49L, 58L, 26L, + 37L, 40L, 33L, 41L, 46L, 40L, 40L, 61L, 35L, 58L, 49L, 52L, 45L, + 67L, 57L, 63L, 53L, 32L, 60L, 44L, 53L, 53L, 49L, 42L, 34L, 41L, + 27L, 48L, 34L, 49L, 46L, 56L, 59L, 62L, 50L, 42L, 53L, 67L, 44L, + 65L, 56L, 30L, 47L, 50L, 34L, 39L, 43L, 46L, 52L, 38L, 33L, 28L, + 34L, 39L, 29L, 52L, 52L, 54L, 52L, 47L, 44L, 42L, 42L, 44L, 60L, + 60L, 50L, 38L, 44L, 54L, 54L, 56L, 51L, 53L, 36L, 59L, 49L, 50L, + 46L, 55L, 46L, 34L, 57L, 41L, 49L, 42L, 31L, 50L, 35L, 38L, 53L, + 42L, 53L, 46L, 50L, 43L, 46L, 41L, 33L, 36L, 33L, 37L, 24L, 42L, + 30L, 42L, 49L, 58L, 26L, 37L, 40L, 33L, 41L, 46L, 40L, 40L, 61L, + 35L, 58L, 49L, 52L, 45L, 67L, 57L, 63L, 53L, 32L, 60L, 44L, 53L, + 53L, 49L, 42L, 34L, 41L, 27L, 48L, 34L, 49L, 46L, 56L, 59L, 62L, + 50L, 42L, 53L, 67L, 44L, 65L, 56L, 30L, 47L, 50L, 34L, 39L, 43L, + 46L, 52L, 38L, 33L, 28L, 34L, 39L, 29L, 52L, 52L, 54L, 52L, 47L, + 44L, 42L, 42L, 44L, 60L, 60L, 50L, 38L, 44L, 54L, 54L, 56L, 51L, + 53L, 36L, 59L, 49L, 50L, 46L, 55L, 46L, 34L, 57L, 41L, 49L, 42L, + 31L, 50L, 35L, 38L, 53L, 42L, 53L, 46L, 50L, 43L, 46L, 41L, 33L, + 36L, 33L, 37L, 24L, 42L, 30L, 42L, 49L, 58L, 26L, 37L, 40L, 33L, + 41L, 46L, 40L, 40L, 61L, 35L, 58L, 49L, 52L, 45L, 67L, 57L, 63L, + 53L, 32L, 60L, 44L, 53L, 53L, 49L, 42L, 34L, 41L, 27L, 48L, 34L, + 49L, 46L, 56L, 59L, 62L, 50L, 42L, 53L, 67L, 44L, 65L, 56L, 30L, + 47L, 50L, 34L, 39L, 43L, 46L, 52L, 38L, 33L, 28L, 34L, 39L, 29L, + 52L, 52L, 54L, 52L, 47L, 44L, 42L, 42L, 44L, 60L, 60L, 50L, 38L, + 44L, 54L, 54L, 56L, 51L, 53L, 36L, 59L, 49L, 50L, 46L, 55L, 46L, + 34L, 57L, 41L, 49L, 42L, 31L, 50L, 35L, 38L, 53L, 42L, 53L, 46L, + 50L, 43L, 46L, 41L, 33L, 36L, 33L, 37L, 24L, 42L, 30L, 42L, 49L, + 58L, 26L, 37L, 40L, 33L, 41L, 46L, 40L, 40L, 61L, 35L, 58L, 49L, + 52L, 45L, 67L, 57L, 63L, 53L), Fem = c(1L, 1L, 1L, 1L, 1L, 1L, + 0L, 0L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, + 1L, 0L, 0L, 0L, 1L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, + 0L, 1L, 1L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 1L, + 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 1L, +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8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, + 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, + 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, + 8L, 8L, 8L, 8L, 8L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, + 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, + 16L), Total = c(30L, 26L, 20L, 61L, 35L, 34L, 32L, 33L, 32L, + 10L, 41L, 19L, 47L, 35L, 44L, 48L, 60L, 53L, 42L, 56L, 64L, 40L, + 58L, 54L, 33L, NA, 43L, 29L, 41L, 31L, 26L, 44L, 19L, 38L, 16L, + 23L, 37L, 42L, 55L, 30L, 52L, 44L, 45L, 34L, 39L, 14L, 34L, 57L, + 53L, 50L, 27L, NA, 53L, 32L, 55L, 50L, 56L, 29L, 53L, 50L, 38L, + 48L, 34L, 44L, 31L, 48L, 40L, 25L, 30L, 18L, 27L, 24L, 25L, 40L, + 48L, 45L, 47L, 42L, 24L, 39L, 30L, 27L, 15L, 32L, NA, 29L, 23L, + 22L, 46L, 25L, 46L, 26L, NA, 24L, 10L, 50L, NA, 28L, 16L, 52L, + 21L, 38L, 45L, 46L, 46L, 63L, NA, 51L, 38L, 24L, 27L, 23L, 64L, + 48L, 43L, 32L, 21L, 34L, 31L, 32L, 21L, 44L, 45L, 48L, 56L, 60L, + 52L, 43L, 52L, 65L, 32L, 55L, 52L, 25L, 54L, 51L, 27L, 33L, 29L, + 29L, 47L, 20L, 40L, 11L, 16L, 39L, 35L, 51L, 43L, 52L, 33L, 41L, + 29L, 38L, 9L, 32L, 53L, 55L, NA, 16L, 46L, 51L, 40L, 44L, 50L, + 47L, 24L, 45L, 48L, 42L, 46L, 26L, 47L, 25L, 50L, 42L, 30L, 40L, + 23L, 43L, 34L, 21L, 38L, 26L, 52L, 45L, 52L, 17L, 25L, 44L, 25L, + 16L, 31L, NA, 18L, 30L, 21L, 41L, 30L, 46L, 27L, 23L, 25L, 13L, + 22L, 41L, 29L, 18L, 61L, 29L, 50L, 36L, 36L, 33L, 71L, 36L, 46L, + NA, 37L, 41L, 26L, 62L, 49L, 48L, 43L, 27L, 35L, 32L, 35L, 24L, + 48L, 49L, 54L, 55L, 64L, 57L, 33L, 54L, 64L, 36L, NA, 48L, 29L, + 43L, 46L, 21L, 39L, 28L, 33L, 50L, 27L, 48L, 7L, 15L, 39L, 24L, + 52L, 45L, 54L, 54L, 45L, 28L, 47L, 9L, 35L, 52L, 62L, 46L, 19L, + 26L, 56L, 52L, 50L, 56L, 53L, 32L, 44L, 56L, 43L, 57L, 40L, 50L, + NA, 50L, 38L, 41L, 43L, 26L, 32L, 28L, 33L, 44L, 37L, 51L, 45L, + 60L, 37L, 15L, 46L, 30L, 17L, 27L, NA, 20L, 36L, 25L, 43L, 49L, + 50L, 22L, 18L, 37L, 16L, 28L, 41L, 30L, 25L, 68L, 30L, 53L, NA, + NA, 44L, 66L, 23L, 50L, 33L, 39L, 65L, 35L, NA, 41L, 48L, 42L, + 32L, 37L, 6L, 57L, 28L, 44L, 53L, 49L, 57L, 67L, 61L, 37L, 55L, + 62L, 42L, 56L, 52L, 32L, 46L, 49L, 22L, 37L, 33L, 45L, 50L, 29L, + 49L, 13L, 17L, 45L, 29L, 54L, 47L, 51L, 46L, 43L, 35L, 39L, 16L, + 54L, 53L, 67L, 50L, 23L, 30L, 39L, 42L, 53L, 59L, 51L, 45L, 50L, + 49L, 42L, 57L, 49L, 46L, NA, 50L, 50L, 41L, 36L, 33L, 40L, 34L, + 42L, 47L, 37L, 52L, 50L, 54L, 36L, 21L, 46L, 28L, 22L, 49L, NA, + 25L, 41L, 26L, 49L, 55L, 56L, 38L, 34L, NA, 32L, 34L, 58L, 37L, + 33L, 59L, 35L, 47L, 40L, 45L, 46L, 68L, NA, 50L, 36L, 36L, 67L, + 35L, NA, 51L, 51L, 46L, 38L, 36L, 14L, 51L, 28L, 44L, 56L, 60L, + 58L, 66L, 54L, 43L, 51L, 64L, 43L, 60L, 53L, 32L, 50L, 53L, 22L, + 37L, 38L, 56L, 49L, 32L, 44L, 21L, 29L, 43L, 42L, 57L, 46L, 57L, + 47L, 41L, 41L, 39L, 33L, 53L, 58L, NA, 57L, 26L, 34L, 9L, 47L, + 52L, 53L, 51L, 36L, 48L, 57L, 46L, 49L, 47L, 51L, NA, 49L, 56L, + 31L, 45L, 41L, 47L, 28L, 53L, 53L, 43L, 53L, 52L, 59L, 38L, 25L, + 44L, 30L, 41L, 60L, NA, 41L, 43L, 33L, 54L, 58L, 60L, 35L, 36L, + 38L, 16L, 36L, 53L, 44L, 48L, 71L, 48L, 59L, 52L, 54L, 48L, 71L, + 52L, 54L, 51L)), .Names = c("Site", "ID", "Treat", "Age", "W0", + "Fem", "Week", "Total"), class = "data.frame", row.names = c(NA, + -545L)) > > > library("partykit") Loading required package: grid Loading required package: libcoin Loading required package: mvtnorm > library("rpart") > > fac <- c(1,3,6) > for(j in 1:length(fac)) datLB[,fac[j]] <- as.factor(datLB[,fac[j]]) > dat <- subset(datLB,Week==16) > dat <- na.omit(dat) > fit <- rpart(Total ~ Site + Treat + Age + W0, + method = "anova", data = dat) > f <- as.party(fit) > plot(f,tp_args = list(id = FALSE)) > f[10]$node$split $varid [1] 3 $breaks NULL $index [1] 2 2 1 $right [1] TRUE $prob [1] 0 1 $info NULL attr(,"class") [1] "partysplit" > > ### factors with empty levels in learning sample > if (require("mlbench")) { + data("Vowel", package = "mlbench") + ct <- ctree(V2 ~ V1, data = Vowel[1:200,]) ### only levels 1:4 in V1 + try(p1 <- predict(ct, newdata = Vowel)) ### 14 levels in V1 + } Loading required package: mlbench Error in model.frame.default(delete.response(object$terms), newdata, xlev = xlev) : factor V1 has new levels 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 > > ### deal with empty levels for teststat = "quad" by > ### removing elements of the teststatistic with zero variance > ### reported by Wei-Yin Loh > tdata <- + structure(list(ytrain = structure(c(3L, 7L, 3L, 2L, 1L, 6L, 2L, + 1L, 1L, 2L, 1L, 2L, 3L, 3L, 2L, 1L, 2L, 6L, 2L, 4L, 6L, 1L, 2L, + 3L, 7L, 6L, 4L, 6L, 2L, 2L, 1L, 2L, 6L, 1L, 7L, 1L, 3L, 6L, 2L, + 1L, 7L, 2L, 7L, 2L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1L, + 143L, 0L, 31L, 23L, 113L, 0L, 47L, 600L, 8512L, 0L, 6L, 111L, + 274L, 678L, 28L, 474L, 9976L, 4L, 0L, 623L, 757L, 9561L, 1139L, + 2L, 342L, 0L, 51L, 115L, 9L, 128L, 43L, 22L, 0L, 49L, 284L, 1001L, + 21L, 28L, 1222L, 1L, 12L, 18L, 337L, 547L, 91L, 268L, 10L, 108L, + 249L, 0L, 132L, 0L, 0L, 109L, 246L, 36L, 215L, 28L, 112L, 1L, + 93L, 103L, 1904L, 1648L, 435L, 70L, 21L, 301L, 323L, 11L, 372L, + 98L, 181L, 583L, 0L, 236L, 10L, 30L, 111L, 0L, 3L, 587L, 118L, + 333L, 0L, 0L, 0L, 1031L, 1973L, 1L, 1566L, 0L, 447L, 783L, 0L, + 140L, 41L, 0L, 268L, 128L, 1267L, 925L, 121L, 195L, 324L, 212L, + 804L, 76L, 463L, 407L, 1285L, 300L, 313L, 9L, 11L, 237L, 26L, + 0L, 2150L, 196L, 72L, 1L, 30L, 637L, 1221L, 99L, 288L, 66L, 0L, + 0L, 0L, 2506L, 63L, 450L, 41L, 185L, 36L, 945L, 514L, 57L, 1L, + 5L, 164L, 781L, 0L, 84L, 236L, 245L, 178L, 0L, 9363L, 22402L, + 15L, 0L, 912L, 333L, 3L, 256L, 905L, 753L, 391L), population = c(16L, + 3L, 20L, 0L, 0L, 7L, 0L, 28L, 28L, 15L, 8L, 0L, 0L, 90L, 0L, + 10L, 0L, 3L, 0L, 1L, 1L, 119L, 0L, 0L, 9L, 7L, 35L, 4L, 8L, 24L, + 0L, 0L, 2L, 11L, 1008L, 28L, 0L, 2L, 0L, 2L, 10L, 1L, 15L, 5L, + 0L, 0L, 6L, 8L, 47L, 5L, 0L, 31L, 0L, 0L, 1L, 5L, 54L, 0L, 1L, + 1L, 17L, 61L, 0L, 10L, 0L, 0L, 8L, 6L, 1L, 1L, 6L, 4L, 5L, 11L, + 0L, 157L, 39L, 14L, 3L, 4L, 57L, 7L, 2L, 118L, 2L, 6L, 17L, 0L, + 3L, 3L, 1L, 1L, 0L, 0L, 9L, 6L, 13L, 0L, 0L, 0L, 2L, 77L, 0L, + 2L, 0L, 20L, 12L, 0L, 16L, 14L, 0L, 2L, 3L, 5L, 56L, 18L, 9L, + 4L, 1L, 84L, 2L, 3L, 3L, 14L, 48L, 36L, 3L, 0L, 22L, 5L, 0L, + 9L, 6L, 3L, 3L, 0L, 5L, 29L, 39L, 2L, 15L, 0L, 0L, 0L, 20L, 0L, + 8L, 6L, 10L, 18L, 18L, 49L, 2L, 0L, 1L, 7L, 45L, 0L, 1L, 13L, + 56L, 3L, 0L, 231L, 274L, 0L, 0L, 15L, 60L, 0L, 22L, 28L, 6L, + 8L), language = structure(c(10L, 6L, 8L, 1L, 6L, 10L, 1L, 2L, + 2L, 1L, 4L, 1L, 8L, 6L, 1L, 6L, 1L, 3L, 1L, 10L, 10L, 6L, 1L, + 10L, 5L, 3L, 10L, 10L, 3L, 1L, 6L, 1L, 10L, 2L, 7L, 2L, 3L, 10L, + 1L, 2L, 2L, 6L, 5L, 6L, 3L, 1L, 2L, 2L, 8L, 2L, 10L, 10L, 6L, + 1L, 1L, 9L, 3L, 3L, 10L, 1L, 4L, 4L, 1L, 6L, 1L, 1L, 2L, 3L, + 6L, 1L, 3L, 2L, 7L, 9L, 6L, 10L, 6L, 8L, 1L, 10L, 6L, 3L, 1L, + 9L, 8L, 10L, 10L, 1L, 10L, 8L, 10L, 10L, 4L, 4L, 10L, 10L, 10L, + 10L, 10L, 10L, 8L, 2L, 10L, 10L, 1L, 8L, 10L, 10L, 10L, 6L, 6L, + 1L, 2L, 3L, 10L, 10L, 8L, 6L, 8L, 6L, 2L, 1L, 2L, 2L, 10L, 5L, + 2L, 8L, 6L, 10L, 6L, 8L, 3L, 1L, 7L, 1L, 10L, 6L, 10L, 8L, 10L, + 1L, 1L, 1L, 8L, 6L, 6L, 4L, 8L, 7L, 10L, 10L, 3L, 10L, 1L, 8L, + 9L, 1L, 8L, 10L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L, 5L, 7L, 2L, 8L, 5L, + 2L, 2L, 8L, 1L, 4L, 7L, 2L, 5L, 1L, 5L, 2L, 7L, 1L, 7L, 2L, + 7L, 5L, 7L, 8L, 7L, 7L, 2L, 1L, 7L, 7L, 8L, 8L, 7L, 7L, 5L, + 8L, 7L, 7L, 7L, 7L, 5L, 3L, 5L), .Label = c("black", "blue", + "brown", "gold", "green", "orange", "red", "white"), class = "factor")), .Names = c("ytrain", + "landmass", "zone", "area", "population", "language", "bars", + "stripes", "colours", "red", "green", "blue", "gold", "white", + "black", "orange", "mainhue", "circles", "crosses", "saltires", + "quarters", "sunstars", "crescent", "triangle", "icon", "animate", + "text", "topleft", "botright"), row.names = c(NA, -174L), class = "data.frame") > tdata$language <- factor(tdata$language) > tdata$ytrain <- factor(tdata$ytrain) > > ### was: error > model <- ctree(ytrain ~ ., data = tdata, + control = ctree_control(testtype = "Univariate", splitstat = "maximum")) > > if (require("coin")) { + ### check against coin (independence_test automatically + ### removes empty levels) + p <- info_node(node_party(model))$criterion["p.value",] + p[is.na(p)] <- 0 + p2 <- sapply(names(p), function(n) + pvalue(independence_test(ytrain ~ ., + data = tdata[, c("ytrain", n)], teststat = "quad"))) + stopifnot(max(abs(p - p2)) < sqrt(.Machine$double.eps)) + + p <- info_node(node_party(model[2]))$criterion["p.value",] + p[is.na(p)] <- 0 + p2 <- sapply(names(p), function(n) + pvalue(independence_test(ytrain ~ ., + data = tdata[tdata$language != "8", c("ytrain", n)], + teststat = "quad"))) + stopifnot(max(abs(p - p2)) < sqrt(.Machine$double.eps)) + + p <- info_node(node_party(model[3]))$criterion["p.value",] + p[is.na(p)] <- 0 + p2 <- sapply(names(p), function(n) + pvalue(independence_test(ytrain ~ ., + data = tdata[!(tdata$language %in% c("2", "4", "8")), + c("ytrain", n)], + teststat = "quad"))) + stopifnot(max(abs(p - p2)) < sqrt(.Machine$double.eps)) + } Loading required package: coin Loading required package: survival > > ### check coersion of constparties to simpleparties > ### containing terminal nodes without corresponding observations > ## create party > data("WeatherPlay", package = "partykit") > py <- party( + partynode(1L, + split = partysplit(1L, index = 1:3), + kids = list( + partynode(2L, + split = partysplit(3L, breaks = 75), + kids = list( + partynode(3L, info = "yes"), + partynode(4L, info = "no"))), + partynode(5L, + split = partysplit(3L, breaks = 20), + kids = list( + partynode(6L, info = "no"), + partynode(7L, info = "yes"))), + partynode(8L, + split = partysplit(4L, index = 1:2), + kids = list( + partynode(9L, info = "yes"), + partynode(10L, info = "no"))))), + WeatherPlay) > names(py) <- LETTERS[nodeids(py)] > > pn <- node_party(py) > cp <- party(pn, + data = WeatherPlay, + fitted = data.frame( + "(fitted)" = fitted_node(pn, data = WeatherPlay), + "(response)" = WeatherPlay$play, + check.names = FALSE), + terms = terms(play ~ ., data = WeatherPlay), + ) > print(cp) [1] root | [2] outlook in sunny | | [3] humidity <= 75: yes | | [4] humidity > 75: no | [5] outlook in overcast | | [6] humidity <= 20: no | | [7] humidity > 20: yes | [8] outlook in rainy | | [9] windy in false: yes | | [10] windy in true: no > cp <- as.constparty(cp) > > nd <- data.frame(outlook = factor("overcast", levels = levels(WeatherPlay$outlook)), + humidity = 10, temperature = 10, windy = "yes") > try(predict(cp, type = "node", newdata = nd)) Error in model.frame.default(delete.response(object$terms), newdata, xlev = xlev) : factor windy has new level yes > try(predict(cp, type = "response", newdata = nd)) Error in model.frame.default(delete.response(object$terms), newdata, xlev = xlev) : factor windy has new level yes > as.simpleparty(cp) Model formula: play ~ outlook + temperature + humidity + windy Fitted party: [1] root | [2] outlook in sunny | | [3] humidity <= 75: yes (n = 2, err = 0.0%) | | [4] humidity > 75: no (n = 3, err = 0.0%) | [5] outlook in overcast | | [6] humidity <= 20: NA (n = 0, err = NA) | | [7] humidity > 20: yes (n = 4, err = 0.0%) | [8] outlook in rainy | | [9] windy in false: yes (n = 3, err = 0.0%) | | [10] windy in true: no (n = 2, err = 0.0%) Number of inner nodes: 4 Number of terminal nodes: 6 > print(cp) Model formula: play ~ outlook + temperature + humidity + windy Fitted party: [1] root | [2] outlook in sunny | | [3] humidity <= 75: yes (n = 2, err = 0.0%) | | [4] humidity > 75: no (n = 3, err = 0.0%) | [5] outlook in overcast | | [6] humidity <= 20: NA (n = 0, err = NA) | | [7] humidity > 20: yes (n = 4, err = 0.0%) | [8] outlook in rainy | | [9] windy in false: yes (n = 3, err = 0.0%) | | [10] windy in true: no (n = 2, err = 0.0%) Number of inner nodes: 4 Number of terminal nodes: 6 > > ### scores > y <- gl(3, 10, ordered = TRUE) > x <- rnorm(length(y)) > x <- ordered(cut(x, 3)) > d <- data.frame(y = y, x = x) > > ### partykit with scores > ct11 <- partykit::ctree(y ~ x, data = d) > ct12 <- partykit::ctree(y ~ x, data = d, + scores = list(y = c(1, 4, 5))) > ct13 <- partykit::ctree(y ~ x, data = d, + scores = list(y = c(1, 4, 5), x = c(1, 5, 6))) > > ### party with scores > ct21 <- party::ctree(y ~ x, data = d) > ct22 <- party::ctree(y ~ x, data = d, + scores = list(y = c(1, 4, 5))) > ct23 <- party::ctree(y ~ x, data = d, + scores = list(y = c(1, 4, 5), x = c(1, 5, 6))) > > stopifnot(all.equal(ct11$node$info$p.value, + 1 - ct21@tree$criterion$criterion, check.attr = FALSE)) > stopifnot(all.equal(ct12$node$info$p.value, + 1 - ct22@tree$criterion$criterion, check.attr = FALSE)) > stopifnot(all.equal(ct13$node$info$p.value, + 1 - ct23@tree$criterion$criterion, check.attr = FALSE)) > > ### ytrafo > y <- runif(100, max = 3) > x <- rnorm(length(y)) > d <- data.frame(y = y, x = x) > > ### partykit with scores > ct11 <- partykit::ctree(y ~ x, data = d) > ct12 <- partykit::ctree(y ~ x, data = d, + ytrafo = list(y = sqrt)) > > ### party with scores > ct21 <- party::ctree(y ~ x, data = d) > f <- function(data) coin::trafo(data, numeric_trafo = sqrt) > ct22 <- party::ctree(y ~ x, data = d, + ytrafo = f) > > stopifnot(all.equal(ct11$node$info$p.value, + 1 - ct21@tree$criterion$criterion, check.attr = FALSE)) > stopifnot(all.equal(ct12$node$info$p.value, + 1 - ct22@tree$criterion$criterion, check.attr = FALSE)) > > > ### spotted by Peter Philip Stephensen (DREAM) > ### splits x >= max(x) where possible in partykit::ctree > nAge <- 30 > d <- data.frame(Age=rep(1:nAge,2),y=c(rep(1,nAge),rep(0,nAge)), + n = rep(0,2*nAge)) > ntot <- 100 > alpha <- .5 > d[d$y==1,]$n = floor(ntot * alpha * d[d$y==1,]$Age / nAge) > d[d$y==0,]$n = ntot - d[d$y==1,]$n > d$n <- as.integer(d$n) > ctrl <- partykit::ctree_control(maxdepth=3, minbucket = min(d$n) + 1) > tree <- partykit::ctree(y ~ Age, weights=n, data=d, control=ctrl) > ## IGNORE_RDIFF_BEGIN > tree Model formula: y ~ Age Fitted party: [1] root | [2] Age <= 15 | | [3] Age <= 7 | | | [4] Age <= 4: 0.038 (n = 400, err = 14.4) | | | [5] Age > 4: 0.097 (n = 300, err = 26.2) | | [6] Age > 7 | | | [7] Age <= 11: 0.155 (n = 400, err = 52.4) | | | [8] Age > 11: 0.222 (n = 400, err = 69.2) | [9] Age > 15 | | [10] Age <= 22: 0.313 (n = 700, err = 150.5) | | [11] Age > 22 | | | [12] Age <= 26: 0.405 (n = 400, err = 96.4) | | | [13] Age > 26: 0.472 (n = 400, err = 99.7) Number of inner nodes: 6 Number of terminal nodes: 7 > ## IGNORE_RDIFF_END > > (w1 <- predict(tree, type = "node")) 4 4 4 4 5 5 5 7 7 7 7 8 8 8 8 10 10 10 10 10 10 10 12 12 12 12 4 4 4 4 5 5 5 7 7 7 7 8 8 8 8 10 10 10 10 10 10 10 12 12 12 12 13 13 13 13 4 4 4 4 5 5 5 7 7 7 7 8 8 8 8 10 10 10 10 10 10 10 13 13 13 13 4 4 4 4 5 5 5 7 7 7 7 8 8 8 8 10 10 10 10 10 10 10 12 12 12 12 13 13 13 13 12 12 12 12 13 13 13 13 > > (ct <- ctree(dist + I(dist^2) ~ speed, data = cars)) Model formula: ~dist + I(dist^2) + speed Fitted party: [1] root | [2] speed <= 12: * | [3] speed > 12 | | [4] speed <= 20: * | | [5] speed > 20: * Number of inner nodes: 2 Number of terminal nodes: 3 > predict(ct) dist I(dist^2) 1 18.20000 409.6667 2 18.20000 409.6667 3 18.20000 409.6667 4 18.20000 409.6667 5 18.20000 409.6667 6 18.20000 409.6667 7 18.20000 409.6667 8 18.20000 409.6667 9 18.20000 409.6667 10 18.20000 409.6667 11 18.20000 409.6667 12 18.20000 409.6667 13 18.20000 409.6667 14 18.20000 409.6667 15 18.20000 409.6667 16 46.28571 2423.1429 17 46.28571 2423.1429 18 46.28571 2423.1429 19 46.28571 2423.1429 20 46.28571 2423.1429 21 46.28571 2423.1429 22 46.28571 2423.1429 23 46.28571 2423.1429 24 46.28571 2423.1429 25 46.28571 2423.1429 26 46.28571 2423.1429 27 46.28571 2423.1429 28 46.28571 2423.1429 29 46.28571 2423.1429 30 46.28571 2423.1429 31 46.28571 2423.1429 32 46.28571 2423.1429 33 46.28571 2423.1429 34 46.28571 2423.1429 35 46.28571 2423.1429 36 46.28571 2423.1429 37 46.28571 2423.1429 38 46.28571 2423.1429 39 46.28571 2423.1429 40 46.28571 2423.1429 41 46.28571 2423.1429 42 46.28571 2423.1429 43 46.28571 2423.1429 44 82.85714 7272.8571 45 82.85714 7272.8571 46 82.85714 7272.8571 47 82.85714 7272.8571 48 82.85714 7272.8571 49 82.85714 7272.8571 50 82.85714 7272.8571 > > ### nodeapply was not the same for permutations of ids > ### spotted by Heidi Seibold > airq <- subset(airquality, !is.na(Ozone)) > airct <- ctree(Ozone ~ ., data = airq) > n1 <- nodeapply(airct, ids = c(3, 5, 6), function(x) x$info$nobs) > n2 <- nodeapply(airct, ids = c(6, 3, 5), function(x) x$info$nobs) > stopifnot(all.equal(n1[names(n2)], n2)) > > ### pruning got "fitted" wrong, spotted by Jason Parker > data("Titanic") > titan <- as.data.frame(Titanic) > (tree <- ctree(Survived ~ Class + Sex + Age, data = titan, weights = Freq)) Model formula: Survived ~ Class + Sex + Age Fitted party: [1] root | [2] Sex in Male | | [3] Class in 1st: No (n = 180, err = 34.4%) | | [4] Class in 2nd, 3rd, Crew | | | [5] Age in Child | | | | [6] Class in 2nd: Yes (n = 11, err = 0.0%) | | | | [7] Class in 3rd: No (n = 48, err = 27.1%) | | | [8] Age in Adult | | | | [9] Class in 2nd, 3rd | | | | | [10] Class in 2nd: No (n = 168, err = 8.3%) | | | | | [11] Class in 3rd: No (n = 462, err = 16.2%) | | | | [12] Class in Crew: No (n = 862, err = 22.3%) | [13] Sex in Female | | [14] Class in 1st, 2nd, Crew | | | [15] Class in 1st: Yes (n = 145, err = 2.8%) | | | [16] Class in 2nd, Crew: Yes (n = 129, err = 12.4%) | | [17] Class in 3rd: No (n = 196, err = 45.9%) Number of inner nodes: 8 Number of terminal nodes: 9 > ### prune off nodes 5-12 and check if the other nodes are not affected > nodeprune(tree, 4) Model formula: Survived ~ Class + Sex + Age Fitted party: [1] root | [2] Sex in Male | | [3] Class in 1st: No (n = 180, err = 34.4%) | | [4] Class in 2nd, 3rd, Crew: No (n = 1551, err = 19.7%) | [5] Sex in Female | | [6] Class in 1st, 2nd, Crew | | | [7] Class in 1st: Yes (n = 145, err = 2.8%) | | | [8] Class in 2nd, Crew: Yes (n = 129, err = 12.4%) | | [9] Class in 3rd: No (n = 196, err = 45.9%) Number of inner nodes: 4 Number of terminal nodes: 5 > > ### this gave a warning "ME is not a factor" > if (require("TH.data")) { + data("mammoexp", package = "TH.data") + a <- cforest(ME ~ PB + SYMPT, data = mammoexp, ntree = 5) + print(predict(a, newdata=mammoexp[1:3,])) + } Loading required package: TH.data Loading required package: MASS Attaching package: 'TH.data' The following object is masked from 'package:MASS': geyser 1 2 3 Never Never Never Levels: Never < Within a Year < Over a Year > > ### pruning didn't work properly > mt <- lmtree(dist ~ speed, data = cars) > mt2 <- nodeprune(mt, 2) > stopifnot(all(mt2$fitted[["(fitted)"]] %in% c(2, 3))) > > ### > a <- rep('N',87) > a[77] <- 'Y' > b <- rep(FALSE, 87) > b[c(7,10,11,33,56,77)] <- TRUE > d <- rep(1,87) > d[c(29,38,40,42,65,77)] <- 0 > dfb <- data.frame(a = as.factor(a), b = as.factor(b), d = as.factor(d)) > tr <- ctree(a ~ ., data = dfb, control = ctree_control(minsplit = 10,minbucket = 5, + maxsurrogate = 2, alpha = 0.05)) > tNodes <- node_party(tr) > ### this creates a tie on purpose and "d" should be selected > ### this check fails on M1mac > nodeInfo <- info_node(tNodes) > nodeInfo$criterion b d statistic 13.5000000000 13.5000000000 p.value 0.0004770700 0.0004770700 criterion -0.0001771838 -0.0001771838 > #stopifnot(names(nodeInfo$p.value) == "d") > #stopifnot(split_node(tNodes)$varid == 3) > > ### reported by John Ogawa, 2020-12-11 > class(dfb$a) <- c("Hansi", "factor") > tr2 <- ctree(a ~ ., data = dfb, control = ctree_control(minsplit = 10,minbucket = 5, + maxsurrogate = 2, alpha = 0.05)) > stopifnot(isTRUE(all.equal(tr, tr2, check.attributes = FALSE))) > > proc.time() user system elapsed 3.35 0.17 3.51