Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
175 65 93 17 3198 472 906 18 72 49 1681 324 228 65 31 357 160 175 21 1993 643 173 6 254 829 88 337 300 19 18 107 62 29 16 5442 1932 1547 106 25 323 1508 1125 150 91 883 310 68 223 20 2245 815 176 5 165 64 1020 2121 1584 137 400 116 58 20 37 1239 478 374 4 97 56 229 7910 118 7426 365 376 70 280 25 6388 1083 1629 1255 907 1298 215 3551 1899 369 1283 230 115 90 25 1679 185 1040 9 20 16 409 1842 745 87 1011 54 33 7 14 830 224 130 7 6 54 408 175 100 50 25 194 44 135 15 2505 1148 346 2 804 53 152 2846 1844 97 905 171 73 78 21 4387 501 2614 1 381 296 593 5934 160 52 5722 311 46 248 17 2162 882 1051 3 13 42 170 2214 925 232 1056 290 81 186 22 11993 4115 7092 7 152 239 389 11672 1864 427 9381 4435 2053 687 1695 18864 11544 1324 433 23 293 5246 1012 183 63 765 440 101 307 32 1979 1533 290 19 10 76 51 222 72 100 50 1430 341 1048 41 19220 16061 422 204 41 759 1733 1494 1107 204 183 820 314 477 29 4410 3057 565 33 37 55 664 1022 845 111 65 223 141 43 39 6942 4858 760 11 182 220 911 881 587 54 240 426 270 122 34 7762 3417 3497 118 111 242 376 11267 9242 611 1414 1693 320 566 807 17814 4783 9768 11 82 114 3057 1248 246 701 301 2068 44 2010 13 2523 1631 458 32 47 219 136 924 256 571 97 832 589 222 20 12586 4622 6225 49 254 237 1199 8451 4807 131 3512 416 149 236 30 2244 1292 449 151 106 58 188 2274 1993 164 117 372 79 262 31 7931 3167 2963 56 94 1467 185 1504 228 62 1214 5266 751 3929 586 15720 4019 6676 122 152 578 4173 8090 7235 294 561 633 155 456 22 3029 1432 354 677 14 25 527 2221 2089 21 111 191 107 35 48 8217 2339 358 54 55 88 5323 305 144 7 154 337 172 138 26 14346 8323 1902 37 489 484 3110 971 465 296 210 280 106 122 52 7944 6085 761 77 408 48 565 850 326 45 479 619 149 270 200 6745 2291 3466 209 119 491 170 1986 1314 208 464 2423 2125 243 55 10650 3023 3415 43 1195 202 2774 3128 1238 1247 643 538 297 189 52 17682 6288 2152 3709 1979 1270 2284 3571 2417 148 1006 294 93 180 20 6789 6005 307 9 127 160 182 2842 2435 249 159 430 293 116 21 10109 5006 2237 49 1162 296 1360 1352 951 211 191 737 325 321 92 11981 6187 1628 168 523 335 3139 5806 4695 763 348 541 169 346 26 24259 2127 19327 1578 89 233 906 4049 1991 308 1749 1214 209 878 126 68744 17503 31561 830 725 571 17553 19550 11173 561 7816 929 130 760 39 85056 3661 76825 11 62 60 4436 58941 22003 92 36845 1288 67 1201 20 3134 2026 101 120 440 412 35 1621 1312 210 99 321 152 148 21 6751 3231 1096 24 62 186 2151 1067 302 83 683 1912 388 1498 25 7098 3226 906 86 60 195 2625 393 86 33 274 146 62 59 25 6142 1805 3666 343 74 185 69 7059 6891 38 130 357 97 225 35 3974 1290 447 179 323 422 1313 7278 1673 5195 410 473 158 280 35 14614 6500 5219 35 236 427 2198 1433 592 160 682 153 55 87 11 13438 2539 643 4 9 9159 1084 2410 2285 35 90 681 521 142 19 9746 6710 529 881 105 863 658 902 420 177 305 337 109 208 20 23024 10028 2608 76 1095 4707 4509 3679 3542 39 98 433 70 332 31 12102 5223 1402 147 40 507 4782 607 211 17 380 751 116 610 26 41056 20553 3504 2593 142 958 13306 4527 1552 278 2697 655 126 475 55 2495 746 188 5 608 13 935 2352 1653 13 686 233 150 36 46 7056 3947 1383 36 19 70 1601 524 111 339 74 118 73 20 25 7708 2218 649 58 1833 474 2475 5784 5569 63 153 146 83 42 21 8229 4053 470 44 217 179 3266 11475 969 10056 450 365 197 153 16 4714 1548 896 8 207 247 1807 2940 499 1367 1074 653 112 519 22 14317 6280 986 369 4304 1989 389 36980 473 35687 820 434 168 168 97 5267 1674 1315 777 14 321 1165 1576 489 86 1002 231 62 156 12 4087 3700 126 11 74 158 18 607 353 21 232 123 50 57 16 3823 843 932 13 161 340 1532 1190 432 296 463 259 113 104 42 2137 1449 310 45 60 154 118 1731 681 247 804 98 46 28 23 4241 2098 548 73 174 963 384 617 120 306 191 2107 222 1839 46 13654 4027 4649 1876 584 1770 748 6107 3067 1179 1860 715 61 622 31 1913 1343 70 10 307 112 70 3524 2863 66 595 136 73 31 32 2380 1763 314 17 22 102 162 1432 94 52 1286 180 111 45 25 5223 731 4038 24 188 99 142 1150 560 184 406 172 63 79 31 2337 1923 127 125 24 129 10 879 585 84 210 170 58 79 33 10031 2334 276 89 467 4178 2687 7430 117 7171 143 380 131 205 45 4588 2647 624 51 49 315 900 3404 169 478 2756 813 110 674 29 9479 3400 4929 782 123 182 62 4945 642 115 4188 708 399 295 14 18171 2434 14635 7 237 852 6 602 420 81 101 193 79 93 22 14015 2237 9832 14 755 1122 55 3590 2114 437 1039 248 76 149 23 4919 1700 1148 244 539 177 1112 5262 4200 145 917 725 184 524 17 4573 513 2482 22 107 114 1334 3349 2550 106 694 13007 326 12645 36 82257 22476 47568 6098 186 974 4954 44336 38503 1757 4075 976 129 824 22 2375 385 728 5 284 92 880 947 385 13 548 185 63 98 24 3772 1961 512 431 99 61 707 1311 263 117 932 234 92 68 75 3954 1135 574 24 123 779 1318 1006 588 331 87 185 72 89 24 4861 698 834 18 2869 254 189 6224 5858 79 287 217 64 130 23 2652 308 918 19 483 161 764 6890 786 5853 251 802 358 404 40 13527 2432 7258 115 912 306 2504 3014 1114 391 1510 705 76 571 57 28039 810 23428 3 730 282 2786 3288 1782 82 1423 304 117 156 30 2874 456 418 311 1126 350 212 1787 551 1076 160 395 230 129 37 11152 765 9300 156 36 605 290 12518 993 2264 9261 439 161 254 24 2727 1018 363 40 30 71 1204 5500 4486 709 305 321 73 228 20 3056 1682 290 6 199 225 655 27519 27188 215 116 1015 231 736 48 47201 4177 33868 639 998 4298 3221 14607 4179 2663 7766 340 57 256 27 2370 1137 205 22 145 302 560 815 594 52 169 372 133 49 190 2439 1870 218 6 24 88 233 851 427 95 330 1772 80 1666 26 10484 6845 1048 1750 30 220 591 1152 869 123 160 163 101 38 24 3107 636 1742 7 335 58 329 3179 949 88 2141 197 118 44 35 14931 1375 377 51 11986 379 762 25090 2163 22199 728 610 79 508 23 8929 1418 401 23 857 2859 3371 3373 1551 703 1119 313 86 198 29 3814 1479 959 15 173 311 878 10931 8889 652 1390
Names of X columns:
O-Totaal O-InbrengInContanten O-InbrengInNatura O-TeStortenBedrag KH-Totaal KH-InbrengInContanten KH-InbrengInNatura KH-TeStortenBedrag KH-ConversieVanEigenMiddelen KH-Schuldconversie KH-Uitgiftepremies KV-Totaal KV-TerugbetalingAanDeAandeelhouders KV-AanzuiveringVanVerliezen KV-Andere
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