Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1 0 149 96 18 68 86 7.5 1.8 2.1 1.5 1 0 152 75 7 55 62 2.5 1.6 1.5 1.8 1 1 139 70 31 39 70 6.0 2.1 2.0 2.1 1 0 148 88 39 32 71 6.5 2.2 2.0 2.1 1 1 158 114 46 62 108 1.0 2.3 2.1 1.9 1 1 128 69 31 33 64 1.0 2.1 2.0 1.6 1 1 224 176 67 52 119 5.5 2.7 2.3 2.1 1 0 159 114 35 62 97 8.5 2.1 2.1 2.1 1 1 105 121 52 77 129 6.5 2.4 2.1 2.2 1 1 159 110 77 76 153 4.5 2.9 2.2 1.5 1 1 167 158 37 41 78 2.0 2.2 2.1 1.9 1 1 165 116 32 48 80 5.0 2.1 2.1 2.2 1 1 159 181 36 63 99 0.5 2.2 2.1 1.6 1 1 119 77 38 30 68 5.0 2.2 2.0 1.5 1 0 176 141 69 78 147 5.0 2.7 2.3 1.9 1 0 54 35 21 19 40 2.5 1.9 1.8 0.1 0 0 91 80 26 31 57 5.0 2.0 2.0 2.2 1 1 163 152 54 66 120 5.5 2.5 2.2 1.8 1 0 124 97 36 35 71 3.5 2.2 2.0 1.6 0 1 137 99 42 42 84 3.0 2.3 2.1 2.2 1 0 121 84 23 45 68 4.0 1.9 2.0 2.1 1 1 153 68 34 21 55 0.5 2.1 1.8 1.9 1 1 148 101 112 25 137 6.5 3.5 2.2 1.6 1 0 221 107 35 44 79 4.5 2.1 2.2 1.9 1 1 188 88 47 69 116 7.5 2.3 1.7 2.2 1 1 149 112 47 54 101 5.5 2.3 2.1 1.8 1 1 244 171 37 74 111 4.0 2.2 2.3 2.4 0 1 148 137 109 80 189 7.5 3.5 2.7 2.4 0 0 92 77 24 42 66 7.0 1.9 1.9 2.5 1 1 150 66 20 61 81 4.0 1.9 2.0 1.9 1 0 153 93 22 41 63 5.5 1.9 2.0 2.1 1 0 94 105 23 46 69 2.5 1.9 1.9 1.9 1 0 156 131 32 39 71 5.5 2.1 2.0 2.1 1 1 146 89 7 63 70 0.5 1.6 2.0 1.9 1 1 132 102 30 34 64 3.5 2.0 2.0 1.5 1 1 161 161 92 51 143 2.5 3.2 2.1 1.9 1 1 105 120 43 42 85 4.5 2.3 2.0 2.1 1 1 97 127 55 31 86 4.5 2.5 1.8 1.5 1 0 151 77 16 39 55 4.5 1.8 2.0 2.1 0 1 131 108 49 20 69 6.0 2.4 2.2 2.1 1 1 166 85 71 49 120 2.5 2.8 2.2 1.8 1 0 157 168 43 53 96 5.0 2.3 2.1 2.4 1 1 111 48 29 31 60 0.0 2.0 1.8 2.1 1 1 145 152 56 39 95 5.0 2.5 1.9 1.9 1 1 162 75 46 54 100 6.5 2.3 2.1 2.1 1 1 163 107 19 49 68 5.0 1.8 2.0 1.9 0 1 59 62 23 34 57 6.0 1.9 1.9 2.4 1 0 187 121 59 46 105 4.5 2.6 2.2 2.1 1 1 109 124 30 55 85 5.5 2.0 2.0 2.2 0 1 90 72 61 42 103 1.0 2.6 2.0 2.2 1 0 105 40 7 50 57 7.5 1.6 1.7 1.8 0 1 83 58 38 13 51 6.0 2.2 2.0 2.1 0 1 116 97 32 37 69 5.0 2.1 2.2 2.4 0 1 42 88 16 25 41 1.0 1.8 1.7 2.2 1 1 148 126 19 30 49 5.0 1.8 2.0 2.1 0 1 155 104 22 28 50 6.5 1.9 2.2 1.5 1 1 125 148 48 45 93 7.0 2.4 2.0 1.9 1 1 116 146 23 35 58 4.5 1.9 1.9 1.8 0 0 128 80 26 28 54 0.0 2.0 2.0 1.8 1 1 138 97 33 41 74 8.5 2.1 2.0 1.6 0 0 49 25 9 6 15 3.5 1.7 1.6 1.2 0 1 96 99 24 45 69 7.5 1.9 2.1 1.8 1 1 164 118 34 73 107 3.5 2.1 2.1 1.5 1 0 162 58 48 17 65 6.0 2.4 2.0 2.1 1 0 99 63 18 40 58 1.5 1.8 1.9 2.4 1 1 202 139 43 64 107 9.0 2.3 2.2 2.4 1 0 186 50 33 37 70 3.5 2.1 2.1 1.5 0 1 66 60 28 25 53 3.5 2.0 1.8 1.8 1 0 183 152 71 65 136 4.0 2.8 2.3 2.1 1 1 214 142 26 100 126 6.5 2.0 2.3 2.2 1 1 188 94 67 28 95 7.5 2.7 2.2 2.1 0 0 104 66 34 35 69 6.0 2.1 2.1 1.9 1 0 177 127 80 56 136 5.0 2.9 2.2 2.1 1 0 126 67 29 29 58 5.5 2.0 1.9 1.9 0 0 76 90 16 43 59 3.5 1.8 1.8 1.6 0 1 99 75 59 59 118 7.5 2.6 2.1 2.4 1 1 157 96 58 52 110 1.0 2.5 1.8 1.9 1 0 139 128 32 50 82 6.5 2.1 2.0 1.9 1 1 78 41 47 3 50 NA 2.3 1.7 1.9 1 0 162 146 43 59 102 6.5 2.3 2.1 2.1 0 1 108 69 38 27 65 6.5 2.2 2.1 1.8 1 0 159 186 29 61 90 7.0 2.0 2.1 2.1 0 0 74 81 36 28 64 3.5 2.2 1.8 2.4 1 1 110 85 32 51 83 1.5 2.1 2.0 2.1 0 0 96 54 35 35 70 4.0 2.1 2.1 2.2 0 0 116 46 21 29 50 7.5 1.9 1.9 2.1 0 0 87 106 29 48 77 4.5 2.0 2.1 2.2 0 1 97 34 12 25 37 0.0 1.7 1.0 1.6 0 0 127 60 37 44 81 3.5 2.2 2.2 2.4 0 1 106 95 37 64 101 5.5 2.2 2.1 2.1 0 1 80 57 47 32 79 5.0 2.3 1.9 1.9 0 0 74 62 51 20 71 4.5 2.4 2.0 2.4 0 0 91 36 32 28 60 2.5 2.1 1.9 2.1 0 0 133 56 21 34 55 7.5 1.9 2.0 1.8 0 1 74 54 13 31 44 7.0 1.7 1.8 2.1 0 1 114 64 14 26 40 0.0 1.8 2.0 1.8 0 1 140 76 -2 58 56 4.5 1.5 2.0 1.9 0 0 95 98 20 23 43 3.0 1.9 2.0 1.9 0 1 98 88 24 21 45 1.5 1.9 1.8 2.4 0 0 121 35 11 21 32 3.5 1.7 2.0 1.8 0 1 126 102 23 33 56 2.5 1.9 1.1 1.8 0 1 98 61 24 16 40 5.5 1.9 1.8 2.1 0 1 95 80 14 20 34 8.0 1.8 1.8 2.1 0 1 110 49 52 37 89 1.0 2.4 2.0 2.4 0 1 70 78 15 35 50 5.0 1.8 1.9 1.9 0 0 102 90 23 33 56 4.5 1.9 2.1 1.8 0 1 86 45 19 27 46 3.0 1.8 1.6 1.8 0 1 130 55 35 41 76 3.0 2.1 2.2 2.2 0 1 96 96 24 40 64 8.0 1.9 1.9 2.4 0 0 102 43 39 35 74 2.5 2.2 2.0 1.8 0 0 100 52 29 28 57 7.0 2.0 2.1 2.4 0 0 94 60 13 32 45 0.0 1.7 1.3 1.8 0 0 52 54 8 22 30 1.0 1.7 1.8 1.9 0 0 98 51 18 44 62 3.5 1.8 1.9 2.4 0 0 118 51 24 27 51 5.5 1.9 2.1 2.1 0 1 99 38 19 17 36 5.5 1.8 1.8 1.9 1 1 48 41 23 12 34 0.5 1 0.75 2.1 1 1 50 146 16 45 61 7.5 1 1.5 2.7 1 1 150 182 33 37 70 9 4 3 2.1 1 1 154 192 32 37 69 9.5 4 2.25 2.1 0 0 109 263 37 108 145 8.5 3 3 2.1 0 1 68 35 14 10 23 7 2 1.5 2.1 1 1 194 439 52 68 120 8 4 3 2.1 1 0 158 214 75 72 147 10 4 3 2.1 1 1 159 341 72 143 215 7 4 3 2.1 1 0 67 58 15 9 24 8.5 2 0.75 2.1 1 0 147 292 29 55 84 9 4 3 2.4 1 1 39 85 13 17 30 9.5 1 2.25 1.95 1 1 100 200 40 37 77 4 3 1.5 2.1 1 1 111 158 19 27 46 6 3 1.5 2.1 1 1 138 199 24 37 61 8 4 2.25 1.95 1 1 101 297 121 58 178 5.5 3 3 2.1 0 1 131 227 93 66 160 9.5 4 3 2.4 1 1 101 108 36 21 57 7.5 3 1.5 2.1 1 1 114 86 23 19 42 7 3 2.25 2.25 1 0 165 302 85 78 163 7.5 4 2.25 2.4 1 1 114 148 41 35 75 8 3 1.5 2.25 1 1 111 178 46 48 94 7 3 2.25 2.55 1 1 75 120 18 27 45 7 2 1.5 1.95 1 1 82 207 35 43 78 6 2 2.25 2.4 1 1 121 157 17 30 47 10 3 2.25 2.1 1 1 32 128 4 25 29 2.5 1 3 2.1 1 0 150 296 28 69 97 9 4 3 2.4 1 1 117 323 44 72 116 8 3 3 2.1 0 1 71 79 10 23 32 6 2 1.5 2.1 1 1 165 70 38 13 50 8.5 4 3 2.25 1 1 154 146 57 61 118 6 4 3 2.25 1 1 126 246 23 43 66 9 4 2.25 2.4 1 0 138 145 26 22 48 8 4 1.5 2.1 1 0 149 196 36 51 86 8 4 2.25 2.1 1 0 145 199 22 67 89 9 4 2.25 2.4 1 1 120 127 40 36 76 5.5 3 3 2.1 1 0 138 91 18 21 39 5 4 0.75 1.95 1 0 109 153 31 44 75 7 3 2.25 2.1 1 0 132 299 11 45 57 5.5 4 3 2.25 1 1 172 228 38 34 72 9 4 3 2.25 1 0 169 190 24 36 60 2 4 1.5 2.4 1 1 114 180 37 72 109 8.5 3 2.25 2.25 1 1 156 212 37 39 76 9 4 3 2.25 1 0 172 269 22 43 65 8.5 4 2.25 2.1 0 1 68 130 15 25 40 9 2 1.5 2.1 0 1 89 179 2 56 58 7.5 2 2.25 2.1 1 1 167 243 43 80 123 10 4 2.25 2.7 1 0 113 190 31 40 71 9 3 1.5 2.1 0 0 115 299 29 73 102 7.5 3 2.25 2.1 0 0 78 121 45 34 80 6 2 1.5 2.25 0 0 118 137 25 72 97 10.5 3 2.25 2.7 0 1 87 305 4 42 46 8.5 2 3 2.4 1 0 173 157 31 61 93 8 4 3 2.1 1 1 2 96 -4 23 19 10 1 3 2.1 0 0 162 183 66 74 140 10.5 4 3 2.4 0 1 49 52 61 16 78 6.5 1 1.5 1.95 0 0 122 238 32 66 98 9.5 4 2.25 2.7 0 1 96 40 31 9 40 8.5 3 1.5 2.1 0 0 100 226 39 41 80 7.5 3 2.25 2.25 0 0 82 190 19 57 76 5 2 2.25 2.1 0 1 100 214 31 48 79 8 3 2.25 2.7 0 0 115 145 36 51 87 10 3 3 2.1 0 1 141 119 42 53 95 7 4 1.5 2.1 1 1 165 222 21 29 49 7.5 4 2.25 1.65 1 1 165 222 21 29 49 7.5 4 2.25 1.65 0 1 110 159 25 55 80 9.5 3 3 2.1 1 1 118 165 32 54 86 6 3 2.25 2.1 1 0 158 249 26 43 69 10 4 3 2.1 0 1 146 125 28 51 79 7 4 2.25 2.1 1 0 49 122 32 20 52 3 1 1.5 2.1 0 0 90 186 41 79 120 6 2 3 2.4 0 0 121 148 29 39 69 7 3 1.5 2.4 1 1 155 274 33 61 94 10 4 3 2.1 0 0 104 172 17 55 72 7 3 3 2.25 0 1 147 84 13 30 43 3.5 4 3 2.4 0 0 110 168 32 55 87 8 3 3 2.1 0 0 108 102 30 22 52 10 3 2.25 2.1 0 0 113 106 34 37 71 5.5 3 2.25 2.4 0 0 115 2 59 2 61 6 3 0.75 2.4 0 1 61 139 13 38 51 6.5 1 3 2.1 0 1 60 95 23 27 50 6.5 1 0.75 2.1 0 1 109 130 10 56 67 8.5 3 1.5 2.4 0 1 68 72 5 25 30 4 2 1.5 2.1 0 0 111 141 31 39 70 9.5 3 3 2.7 0 0 77 113 19 33 52 8 2 1.5 2.1 0 1 73 206 32 43 75 8.5 2 2.25 2.1 1 0 151 268 30 57 87 5.5 4 3 2.25 0 0 89 175 25 43 69 7 2 3 2.1 0 0 78 77 48 23 72 9 2 1.5 2.4 0 0 110 125 35 44 79 8 3 3 2.25 1 1 220 255 67 54 121 10 4 3 2.25 0 1 65 111 15 28 43 8 2 1.5 2.1 1 0 141 132 22 36 58 6 4 1.5 2.1 0 0 117 211 18 39 57 8 3 2.25 2.4 1 1 122 92 33 16 50 5 4 1.5 2.25 0 0 63 76 46 23 69 9 2 1.5 2.1 1 1 44 171 24 40 64 4.5 1 2.25 2.1 0 1 52 83 14 24 38 8.5 1 1.5 1.65 0 1 62 119 23 29 53 7 1 2.25 1.65 0 0 131 266 12 78 90 9.5 4 3 2.7 0 1 101 186 38 57 96 8.5 3 3 2.1 0 1 42 50 12 37 49 7.5 1 0.75 1.95 1 1 152 117 28 27 56 7.5 4 1.5 2.25 1 0 107 219 41 61 102 5 3 1.5 2.4 0 0 77 246 12 27 40 7 2 2.25 1.95 1 0 154 279 31 69 100 8 4 2.25 2.1 1 1 103 148 33 34 67 5.5 3 1.5 2.4 0 1 96 137 34 44 78 8.5 3 2.25 2.1 1 0 154 130 41 21 62 7.5 4 0.75 2.1 1 1 175 181 21 34 55 9.5 4 2.25 2.4 0 1 57 98 20 39 59 7 1 0.75 2.4 0 0 112 226 44 51 96 8 3 2.25 2.4 1 0 143 234 52 34 86 8.5 4 3 2.25 0 0 49 138 7 31 38 3.5 1 0.75 2.4 1 1 110 85 29 13 43 6.5 3 0.75 2.1 1 1 131 66 11 12 23 6.5 4 3 2.1 1 0 167 236 26 51 77 10.5 4 3 1.8 0 0 56 106 24 24 48 8.5 1 3 2.7 1 0 137 135 7 19 26 8 4 3 2.1 0 1 86 122 60 30 91 10 2 1.5 2.1 1 1 121 218 13 81 94 10 3 3 2.4 1 0 149 199 20 42 62 9.5 4 3 2.55 1 0 168 112 52 22 74 9 4 3 2.55 1 0 140 278 28 85 114 10 4 3 2.1 0 1 88 94 25 27 52 7.5 2 1.5 2.1 1 1 168 113 39 25 64 4.5 4 2.25 2.1 1 1 94 84 9 22 31 4.5 2 0.75 2.25 1 1 51 86 19 19 38 0.5 1 0.75 2.25 0 0 48 62 13 14 27 6.5 1 2.25 2.1 1 1 145 222 60 45 105 4.5 4 3 2.1 1 1 66 167 19 45 64 5.5 2 2.25 1.95 0 1 85 82 34 28 62 5 2 3 2.4 1 0 109 207 14 51 65 6 3 2.25 2.1 0 0 63 184 17 41 58 4 2 3 2.4 0 1 102 83 45 31 76 8 3 1.5 2.4 0 0 162 183 66 74 140 10.5 4 3 2.4 1 1 128 85 24 24 48 8.5 4 3 2.25 0 1 86 89 48 19 68 6.5 2 0.75 1.95 0 1 114 225 29 51 80 8 3 1.5 2.1 1 0 164 237 -2 73 71 8.5 4 3 2.1 1 1 119 102 51 24 76 5.5 3 3 2.55 1 0 126 221 2 61 63 7 4 3 2.1 1 1 132 128 24 23 46 5 4 2.25 2.1 1 1 142 91 40 14 53 3.5 4 2.25 2.1 1 0 83 198 20 54 74 5 2 3 1.95 0 1 94 204 19 51 70 9 2 1.5 2.25 0 0 81 158 16 62 78 8.5 2 2.25 2.4 1 1 166 138 20 36 56 5 4 2.25 1.95 0 0 110 226 40 59 100 9.5 3 2.25 2.1 0 1 64 44 27 24 51 3 2 0.75 2.1 1 0 93 196 25 26 52 1.5 2 2.25 1.95 0 0 104 83 49 54 102 6 3 1.5 2.1 0 1 105 79 39 39 78 0.5 3 2.25 2.1 0 1 49 52 61 16 78 6.5 1 1.5 1.95 0 0 88 105 19 36 55 7.5 2 0.75 2.1 0 1 95 116 67 31 98 4.5 2 1.5 1.95 0 1 102 83 45 31 76 8 3 1.5 2.4 0 0 99 196 30 42 73 9 3 2.25 2.4 0 1 63 153 8 39 47 7.5 2 1.5 2.4 0 0 76 157 19 25 45 8.5 2 1.5 1.95 0 0 109 75 52 31 83 7 3 3 2.7 0 1 117 106 22 38 60 9.5 3 2.25 2.1 0 1 57 58 17 31 48 6.5 1 1.5 1.95 0 0 120 75 33 17 50 9.5 3 0.75 2.1 0 1 73 74 34 22 56 6 2 2.25 1.95 0 0 91 185 22 55 77 8 2 3 2.1 0 0 108 265 30 62 91 9.5 3 3 2.25 0 1 105 131 25 51 76 8 3 1.5 2.7 1 0 117 139 38 30 68 8 3 1.5 2.1 0 0 119 196 26 49 74 9 3 2.25 2.4 0 1 31 78 13 16 29 5 1 0.75 1.35
Names of X columns:
C G LFM B PRH CH H Exam.10 PR.4 PE.3 PA.3
Endogenous Variable (Column Number)
Categorization
quantiles
none
quantiles
hclust
equal
Number of categories (only if categorization<>none)
Cross-Validation? (only if categorization<>none)
yes
no
yes
Chart options
R Code
par4 <- 'yes' par3 <- '2' par2 <- 'equal' par1 <- '8' library(party) library(Hmisc) par1 <- as.numeric(par1) par3 <- as.numeric(par3) x <- data.frame(t(y)) is.data.frame(x) x <- x[!is.na(x[,par1]),] k <- length(x[1,]) n <- length(x[,1]) colnames(x)[par1] x[,par1] if (par2 == 'kmeans') { cl <- kmeans(x[,par1], par3) print(cl) clm <- matrix(cbind(cl$centers,1:par3),ncol=2) clm <- clm[sort.list(clm[,1]),] for (i in 1:par3) { cl$cluster[cl$cluster==clm[i,2]] <- paste('C',i,sep='') } cl$cluster <- as.factor(cl$cluster) print(cl$cluster) x[,par1] <- cl$cluster } if (par2 == 'quantiles') { x[,par1] <- cut2(x[,par1],g=par3) } if (par2 == 'hclust') { hc <- hclust(dist(x[,par1])^2, 'cen') print(hc) memb <- cutree(hc, k = par3) dum <- c(mean(x[memb==1,par1])) for (i in 2:par3) { dum <- c(dum, mean(x[memb==i,par1])) } hcm <- matrix(cbind(dum,1:par3),ncol=2) hcm <- hcm[sort.list(hcm[,1]),] for (i in 1:par3) { memb[memb==hcm[i,2]] <- paste('C',i,sep='') } memb <- as.factor(memb) print(memb) x[,par1] <- memb } if (par2=='equal') { ed <- cut(as.numeric(x[,par1]),par3,labels=paste('C',1:par3,sep='')) x[,par1] <- as.factor(ed) } table(x[,par1]) colnames(x) colnames(x)[par1] x[,par1] if (par2 == 'none') { m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) } load(file='createtable') if (par2 != 'none') { m <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data = x) if (par4=='yes') { a<-table.start() a<-table.row.start(a) a<-table.element(a,'10-Fold Cross Validation',3+2*par3,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'',1,TRUE) a<-table.element(a,'Prediction (training)',par3+1,TRUE) a<-table.element(a,'Prediction (testing)',par3+1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Actual',1,TRUE) for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) a<-table.element(a,'CV',1,TRUE) for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) a<-table.element(a,'CV',1,TRUE) a<-table.row.end(a) for (i in 1:10) { ind <- sample(2, nrow(x), replace=T, prob=c(0.9,0.1)) m.ct <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data =x[ind==1,]) if (i==1) { m.ct.i.pred <- predict(m.ct, newdata=x[ind==1,]) m.ct.i.actu <- x[ind==1,par1] m.ct.x.pred <- predict(m.ct, newdata=x[ind==2,]) m.ct.x.actu <- x[ind==2,par1] } else { m.ct.i.pred <- c(m.ct.i.pred,predict(m.ct, newdata=x[ind==1,])) m.ct.i.actu <- c(m.ct.i.actu,x[ind==1,par1]) m.ct.x.pred <- c(m.ct.x.pred,predict(m.ct, newdata=x[ind==2,])) m.ct.x.actu <- c(m.ct.x.actu,x[ind==2,par1]) } } print(m.ct.i.tab <- table(m.ct.i.actu,m.ct.i.pred)) numer <- 0 for (i in 1:par3) { print(m.ct.i.tab[i,i] / sum(m.ct.i.tab[i,])) numer <- numer + m.ct.i.tab[i,i] } print(m.ct.i.cp <- numer / sum(m.ct.i.tab)) print(m.ct.x.tab <- table(m.ct.x.actu,m.ct.x.pred)) numer <- 0 for (i in 1:par3) { print(m.ct.x.tab[i,i] / sum(m.ct.x.tab[i,])) numer <- numer + m.ct.x.tab[i,i] } print(m.ct.x.cp <- numer / sum(m.ct.x.tab)) for (i in 1:par3) { a<-table.row.start(a) a<-table.element(a,paste('C',i,sep=''),1,TRUE) for (jjj in 1:par3) a<-table.element(a,m.ct.i.tab[i,jjj]) a<-table.element(a,round(m.ct.i.tab[i,i]/sum(m.ct.i.tab[i,]),4)) for (jjj in 1:par3) a<-table.element(a,m.ct.x.tab[i,jjj]) a<-table.element(a,round(m.ct.x.tab[i,i]/sum(m.ct.x.tab[i,]),4)) a<-table.row.end(a) } a<-table.row.start(a) a<-table.element(a,'Overall',1,TRUE) for (jjj in 1:par3) a<-table.element(a,'-') a<-table.element(a,round(m.ct.i.cp,4)) for (jjj in 1:par3) a<-table.element(a,'-') a<-table.element(a,round(m.ct.x.cp,4)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable3.tab') } } m bitmap(file='test1.png') plot(m) dev.off() bitmap(file='test1a.png') plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response') dev.off() if (par2 == 'none') { forec <- predict(m) result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec)) colnames(result) <- c('Actuals','Forecasts','Residuals') print(result) } if (par2 != 'none') { print(cbind(as.factor(x[,par1]),predict(m))) myt <- table(as.factor(x[,par1]),predict(m)) print(myt) } bitmap(file='test2.png') if(par2=='none') { op <- par(mfrow=c(2,2)) plot(density(result$Actuals),main='Kernel Density Plot of Actuals') plot(density(result$Residuals),main='Kernel Density Plot of Residuals') plot(result$Forecasts,result$Actuals,main='Actuals versus Predictions',xlab='Predictions',ylab='Actuals') plot(density(result$Forecasts),main='Kernel Density Plot of Predictions') par(op) } if(par2!='none') { plot(myt,main='Confusion Matrix',xlab='Actual',ylab='Predicted') } dev.off() if (par2 == 'none') { detcoef <- cor(result$Forecasts,result$Actuals) a<-table.start() a<-table.row.start(a) a<-table.element(a,'Goodness of Fit',2,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Correlation',1,TRUE) a<-table.element(a,round(detcoef,4)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'R-squared',1,TRUE) a<-table.element(a,round(detcoef*detcoef,4)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'RMSE',1,TRUE) a<-table.element(a,round(sqrt(mean((result$Residuals)^2)),4)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable1.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Actuals, Predictions, and Residuals',4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'#',header=TRUE) a<-table.element(a,'Actuals',header=TRUE) a<-table.element(a,'Forecasts',header=TRUE) a<-table.element(a,'Residuals',header=TRUE) a<-table.row.end(a) for (i in 1:length(result$Actuals)) { a<-table.row.start(a) a<-table.element(a,i,header=TRUE) a<-table.element(a,result$Actuals[i]) a<-table.element(a,result$Forecasts[i]) a<-table.element(a,result$Residuals[i]) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable.tab') } if (par2 != 'none') { a<-table.start() a<-table.row.start(a) a<-table.element(a,'Confusion Matrix (predicted in columns / actuals in rows)',par3+1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'',1,TRUE) for (i in 1:par3) { a<-table.element(a,paste('C',i,sep=''),1,TRUE) } a<-table.row.end(a) for (i in 1:par3) { a<-table.row.start(a) a<-table.element(a,paste('C',i,sep=''),1,TRUE) for (j in 1:par3) { a<-table.element(a,myt[i,j]) } a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable2.tab') }
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation