Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1818 279055 73 96 42 159 130 140824 186099 165 1412 209884 73 75 38 149 143 110459 113854 132 2049 233446 82 70 46 178 118 105079 99776 121 2733 222117 106 134 42 164 146 112098 106194 145 1330 179751 54 72 30 100 73 43929 100792 71 631 70849 28 8 35 129 89 76173 47552 47 5185 568125 131 169 40 156 146 187326 250931 177 381 33186 19 1 18 67 22 22807 6853 5 2150 227332 62 88 38 148 132 144408 115466 124 1978 258676 47 98 37 132 92 66485 110896 92 2413 351915 118 106 46 169 147 79089 169351 149 2352 260484 129 122 60 230 203 81625 94853 93 2029 202918 79 57 37 122 113 68788 72591 70 3020 368577 85 139 55 191 171 103297 101345 148 2265 269455 88 87 44 162 87 69446 113713 100 5081 394578 186 176 63 237 208 114948 165354 142 2362 335567 76 114 40 156 153 167949 164263 194 3537 423110 171 121 43 157 97 125081 135213 113 1477 182016 58 103 32 123 95 125818 111669 162 2397 267365 88 135 52 203 197 136588 134163 186 2545 279428 72 123 49 187 160 112431 140303 147 3126 506616 109 97 41 152 148 103037 150773 137 1618 206722 47 74 25 89 84 82317 111848 71 1787 200004 58 103 57 227 227 118906 102509 123 3791 257139 132 158 45 165 154 83515 96785 134 3069 263110 136 116 42 162 151 104581 116136 115 3073 296850 133 102 45 174 142 103129 158376 138 2224 307100 89 132 43 154 148 83243 153990 125 1744 184160 58 62 36 129 110 37110 64057 66 3218 393860 79 150 45 174 149 113344 230054 137 2599 309877 86 138 50 195 179 139165 184531 152 2116 252512 82 50 50 186 149 86652 114198 159 2483 367819 101 141 51 197 187 112302 198299 159 1187 115602 46 48 42 157 153 69652 33750 31 3566 430118 103 141 44 168 163 119442 189723 185 2764 273950 56 83 42 159 127 69867 100826 78 3755 428077 128 112 44 161 151 101629 188355 117 2061 251349 91 79 40 153 100 70168 104470 109 947 115658 33 33 17 55 46 31081 58391 41 3699 388812 207 149 43 166 156 103925 164808 149 3398 343783 85 126 41 151 128 92622 134097 123 1922 202289 75 82 41 148 111 79011 80238 103 1922 214344 81 84 40 129 119 93487 133252 87 1819 182398 65 68 49 181 148 64520 54518 71 2598 157164 84 50 52 93 65 93473 121850 51 5568 459440 155 101 42 150 134 114360 79367 70 918 78800 42 20 26 82 66 33032 56968 21 2413 217932 84 101 59 229 201 96125 106314 155 4144 368086 122 150 50 193 177 151911 191889 172 2536 210554 66 116 50 176 156 89256 104864 133 2164 244640 79 99 47 179 158 95676 160792 125 496 24188 24 8 4 12 7 5950 15049 7 2688 399093 331 88 51 181 175 149695 191179 158 744 65029 17 21 18 67 61 32551 25109 21 1161 101097 64 30 14 52 41 31701 45824 35 3215 297973 62 97 41 148 133 100087 129711 133 2954 369627 90 163 61 230 228 169707 210012 169 3968 367127 204 132 40 148 140 150491 194679 256 2798 374143 150 161 44 160 155 120192 197680 190 2324 270099 88 89 40 155 141 95893 81180 100 4076 391871 150 160 51 198 181 151715 197765 171 3293 315924 121 139 29 104 75 176225 214738 267 3132 291391 124 104 43 169 97 59900 96252 80 2808 286417 92 100 42 163 142 104767 124527 126 1745 276201 78 66 41 151 136 114799 153242 132 2109 267432 71 163 30 116 87 72128 145707 121 2140 215924 140 93 39 153 140 143592 113963 156 2945 252767 156 85 51 195 169 89626 134904 133 2536 260919 86 150 40 149 129 131072 114268 199 1737 182961 73 143 29 106 92 126817 94333 98 2679 256967 73 107 47 179 160 81351 102204 109 893 73566 32 22 23 88 67 22618 23824 25 2389 272362 93 85 48 185 179 88977 111563 113 2061 216802 60 86 38 133 90 92059 91313 126 2220 228835 68 131 42 164 144 81897 89770 137 2369 371391 90 140 46 169 144 108146 100125 121 3207 393845 102 156 40 153 144 126372 165278 178 1974 220401 109 81 45 166 134 249771 181712 63 2487 225825 69 137 42 164 146 71154 80906 109 2126 217623 70 102 41 146 121 71571 75881 101 2075 199011 52 72 37 141 112 55918 83963 61 4228 483074 131 161 47 183 145 160141 175721 157 1370 145943 70 30 26 99 99 38692 68580 38 2448 295224 108 120 48 134 96 102812 136323 159 870 80953 25 49 8 28 27 56622 55792 58 2169 171206 60 63 27 101 77 15986 25157 27 1573 179344 61 76 38 139 137 123534 100922 108 4045 415550 221 85 41 159 151 108535 118845 83 3116 369093 128 146 61 222 126 93879 170492 88 3098 180679 106 165 45 171 159 144551 81716 164 2605 298696 103 89 41 154 101 56750 115750 96 2404 292260 84 168 42 154 144 127654 105590 192 1931 199481 67 48 35 129 102 65594 92795 94 3146 282361 77 149 36 140 135 59938 82390 107 2598 329281 89 75 40 156 147 146975 135599 144 2108 234577 48 107 40 156 155 165904 127667 136 2193 297995 67 116 38 138 138 169265 163073 171 2262 305984 88 165 43 153 113 183500 211381 210 4197 416463 162 155 65 251 248 165986 189944 193 4022 412530 117 165 33 126 116 184923 226168 297 2841 297080 141 121 51 198 176 140358 117495 125 2493 318283 70 156 45 168 140 149959 195894 204 2208 202726 195 81 36 138 59 57224 80684 70 602 43287 14 13 19 71 64 43750 19630 49 2434 223456 86 113 25 90 40 48029 88634 82 2513 258249 158 112 44 167 98 104978 139292 205 2900 299566 57 133 45 172 139 100046 128602 111 2786 321797 95 169 44 162 135 101047 135848 135 1376 174736 89 30 35 129 97 197426 178377 59 3314 169545 101 121 46 179 142 160902 106330 70 2106 354041 77 82 44 163 155 147172 178303 108 2331 303273 90 148 45 164 115 109432 116938 141 400 23668 13 12 1 0 0 1168 5841 11 2233 196743 79 146 40 155 103 83248 106020 130 530 61857 25 23 11 32 30 25162 24610 28 1946 207339 53 84 51 189 130 45724 74151 101 3199 431443 122 163 38 140 102 110529 232241 216 387 21054 16 4 0 0 0 855 6622 4 2137 252805 52 81 30 111 77 101382 127097 97 492 31961 22 18 8 25 9 14116 13155 39 3808 354622 123 118 43 159 150 89506 160501 119 2183 251240 76 76 48 183 163 135356 91502 118 1789 187003 95 55 49 184 148 116066 24469 41 1864 172481 57 57 32 119 94 144244 88229 107 568 38214 34 16 8 27 21 8773 13983 16 2504 256082 52 93 43 163 151 102153 80716 69 2819 358276 84 137 52 198 187 117440 157384 160 1463 211775 66 50 53 205 171 104128 122975 158 3927 445926 89 152 49 191 170 134238 191469 161 2554 348017 99 163 48 187 145 134047 231257 165 3506 441946 133 142 56 210 198 279488 258287 246 1458 208962 41 77 45 166 152 79756 122531 89 1214 105332 45 42 40 145 112 66089 61394 49 3062 315267 360 94 48 187 173 102070 86480 107 4535 465449 197 128 50 186 177 146760 195791 182 1844 160740 60 63 43 164 153 154771 18284 16 4365 412099 138 127 46 172 161 165933 147581 173 2037 173802 83 59 40 147 115 64593 72558 90 2046 292443 54 118 45 167 147 92280 147341 140 2564 283913 100 110 46 158 124 67150 114651 142 1996 234262 120 44 37 144 57 128692 100187 126 4097 386740 124 95 45 169 144 124089 130332 123 2339 246963 92 128 39 145 126 125386 134218 239 2035 173260 63 41 21 79 78 37238 10901 15 3241 346748 108 146 50 194 153 140015 145758 170 1974 176654 58 147 55 212 196 150047 75767 123 2770 264767 92 121 40 148 130 154451 134969 151 2748 314070 112 185 48 171 159 156349 169216 194 2 1 0 0 0 0 0 0 0 0 207 14688 10 4 0 0 0 6023 7953 5 5 98 1 0 0 0 0 0 0 0 8 455 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2415 284420 92 85 46 141 94 84601 105406 122 3462 410509 164 157 52 204 129 68946 174586 173 0 0 0 0 0 0 0 0 0 0 4 203 4 0 0 0 0 0 0 0 151 7199 5 7 0 0 0 1644 4245 6 474 46660 20 12 5 15 13 6179 21509 13 141 17547 5 0 1 4 4 3926 7670 3 1145 121550 46 37 48 172 89 52789 15673 35 29 969 2 0 0 0 0 0 0 0 2066 242258 73 62 34 125 71 100350 75882 72
Names of X columns:
P H NOL B TRC FeedBMes LPM CW:Char CH Blog
Sample Range:
(leave blank to include all observations)
From:
To:
Column Number of Endogenous Series
(?)
Fixed Seasonal Effects
Do not include Seasonal Dummies
Do not include Seasonal Dummies
Include Seasonal Dummies
Type of Equation
No Linear Trend
No Linear Trend
Linear Trend
First Differences
Seasonal Differences (s)
First and Seasonal Differences (s)
Degree of Predetermination (lagged endogenous variables)
Degree of Seasonal Predetermination
Seasonality
12
1
2
3
4
5
6
7
8
9
10
11
12
Chart options
R Code
library(lattice) library(lmtest) n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test par1 <- as.numeric(par1) x <- t(y) k <- length(x[1,]) n <- length(x[,1]) x1 <- cbind(x[,par1], x[,1:k!=par1]) mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) colnames(x1) <- mycolnames #colnames(x)[par1] x <- x1 if (par3 == 'First Differences'){ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) for (i in 1:n-1) { for (j in 1:k) { x2[i,j] <- x[i+1,j] - x[i,j] } } x <- x2 } if (par2 == 'Include Monthly Dummies'){ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) for (i in 1:11){ x2[seq(i,n,12),i] <- 1 } x <- cbind(x, x2) } if (par2 == 'Include Quarterly Dummies'){ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) for (i in 1:3){ x2[seq(i,n,4),i] <- 1 } x <- cbind(x, x2) } k <- length(x[1,]) if (par3 == 'Linear Trend'){ x <- cbind(x, c(1:n)) colnames(x)[k+1] <- 't' } x k <- length(x[1,]) df <- as.data.frame(x) (mylm <- lm(df)) (mysum <- summary(mylm)) if (n > n25) { kp3 <- k + 3 nmkm3 <- n - k - 3 gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) numgqtests <- 0 numsignificant1 <- 0 numsignificant5 <- 0 numsignificant10 <- 0 for (mypoint in kp3:nmkm3) { j <- 0 numgqtests <- numgqtests + 1 for (myalt in c('greater', 'two.sided', 'less')) { j <- j + 1 gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value } if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 } gqarr } bitmap(file='test0.png') plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') points(x[,1]-mysum$resid) grid() dev.off() bitmap(file='test1.png') plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') grid() dev.off() bitmap(file='test2.png') hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') grid() dev.off() bitmap(file='test3.png') densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') dev.off() bitmap(file='test4.png') qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') qqline(mysum$resid) grid() dev.off() (myerror <- as.ts(mysum$resid)) bitmap(file='test5.png') dum <- cbind(lag(myerror,k=1),myerror) dum dum1 <- dum[2:length(myerror),] dum1 z <- as.data.frame(dum1) z plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') lines(lowess(z)) abline(lm(z)) grid() dev.off() bitmap(file='test6.png') acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') grid() dev.off() bitmap(file='test7.png') pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') grid() dev.off() bitmap(file='test8.png') opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) plot(mylm, las = 1, sub='Residual Diagnostics') par(opar) dev.off() if (n > n25) { bitmap(file='test9.png') plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') grid() dev.off() } load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) a<-table.row.end(a) myeq <- colnames(x)[1] myeq <- paste(myeq, '[t] = ', sep='') for (i in 1:k){ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') if (rownames(mysum$coefficients)[i] != '(Intercept)') { myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') } } myeq <- paste(myeq, ' + e[t]') a<-table.row.start(a) a<-table.element(a, myeq) 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,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Variable',header=TRUE) a<-table.element(a,'Parameter',header=TRUE) a<-table.element(a,'S.D.',header=TRUE) a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE) a<-table.element(a,'2-tail p-value',header=TRUE) a<-table.element(a,'1-tail p-value',header=TRUE) a<-table.row.end(a) for (i in 1:k){ a<-table.row.start(a) a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) a<-table.element(a,mysum$coefficients[i,1]) a<-table.element(a, round(mysum$coefficients[i,2],6)) a<-table.element(a, round(mysum$coefficients[i,3],4)) a<-table.element(a, round(mysum$coefficients[i,4],6)) a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable2.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Multiple R',1,TRUE) a<-table.element(a, sqrt(mysum$r.squared)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'R-squared',1,TRUE) a<-table.element(a, mysum$r.squared) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Adjusted R-squared',1,TRUE) a<-table.element(a, mysum$adj.r.squared) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (value)',1,TRUE) a<-table.element(a, mysum$fstatistic[1]) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) a<-table.element(a, mysum$fstatistic[2]) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) a<-table.element(a, mysum$fstatistic[3]) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'p-value',1,TRUE) a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Residual Standard Deviation',1,TRUE) a<-table.element(a, mysum$sigma) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Sum Squared Residuals',1,TRUE) a<-table.element(a, sum(myerror*myerror)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable3.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Time or Index', 1, TRUE) a<-table.element(a, 'Actuals', 1, TRUE) a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE) a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE) a<-table.row.end(a) for (i in 1:n) { a<-table.row.start(a) a<-table.element(a,i, 1, TRUE) a<-table.element(a,x[i]) a<-table.element(a,x[i]-mysum$resid[i]) a<-table.element(a,mysum$resid[i]) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable4.tab') if (n > n25) { a<-table.start() a<-table.row.start(a) a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'p-values',header=TRUE) a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'breakpoint index',header=TRUE) a<-table.element(a,'greater',header=TRUE) a<-table.element(a,'2-sided',header=TRUE) a<-table.element(a,'less',header=TRUE) a<-table.row.end(a) for (mypoint in kp3:nmkm3) { a<-table.row.start(a) a<-table.element(a,mypoint,header=TRUE) a<-table.element(a,gqarr[mypoint-kp3+1,1]) a<-table.element(a,gqarr[mypoint-kp3+1,2]) a<-table.element(a,gqarr[mypoint-kp3+1,3]) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable5.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Description',header=TRUE) a<-table.element(a,'# significant tests',header=TRUE) a<-table.element(a,'% significant tests',header=TRUE) a<-table.element(a,'OK/NOK',header=TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'1% type I error level',header=TRUE) a<-table.element(a,numsignificant1) a<-table.element(a,numsignificant1/numgqtests) if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' a<-table.element(a,dum) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'5% type I error level',header=TRUE) a<-table.element(a,numsignificant5) a<-table.element(a,numsignificant5/numgqtests) if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' a<-table.element(a,dum) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'10% type I error level',header=TRUE) a<-table.element(a,numsignificant10) a<-table.element(a,numsignificant10/numgqtests) if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' a<-table.element(a,dum) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable6.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