Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
38 1724 270018 90 476 140824 165 3 34 1209 179444 63 429 110459 135 4 42 1844 222373 59 673 105079 121 16 38 2683 218443 135 1137 112098 148 2 27 1149 162874 48 348 43929 73 1 35 631 70849 46 179 76173 49 3 33 4513 498732 109 2201 187326 185 0 18 381 33186 46 111 22807 5 0 34 1997 207822 75 735 144408 125 7 33 1758 213274 72 595 66485 93 0 44 2079 298841 80 780 79089 154 0 55 2128 237633 61 660 81625 98 7 37 1659 164107 60 633 68788 70 8 52 2934 358752 114 1163 103297 148 4 43 1944 222781 46 622 69446 100 10 59 4764 369889 127 1650 114948 150 0 36 2122 305704 58 746 167949 197 6 39 2956 322896 90 1157 125081 114 4 29 1438 176082 41 507 125818 169 3 49 2320 263411 62 683 136588 200 8 45 2471 271965 99 828 112431 148 0 39 2769 425544 101 1203 103037 140 1 25 1442 179306 62 461 82317 74 5 52 1717 189897 65 601 118906 128 9 41 3220 220665 150 1201 83515 140 1 38 2733 214779 72 990 104581 116 0 41 2824 267198 91 1061 103129 147 5 43 1968 270750 73 617 83243 132 0 32 1495 155915 53 559 37110 70 0 41 2745 330118 140 1031 113344 144 0 46 2290 281588 50 911 139165 155 3 49 1830 204039 83 615 86652 165 6 48 2090 318563 53 779 112302 161 1 37 945 97717 40 310 69652 31 4 39 3092 369331 72 1198 119442 199 4 42 2764 273950 87 1186 69867 78 0 43 3658 422946 74 1317 101629 121 0 36 1842 215710 67 611 70168 112 2 17 934 115469 36 276 31081 41 1 39 3342 343095 45 1185 103925 158 2 39 3246 324178 42 1490 92622 123 10 41 1629 170369 75 646 79011 104 9 36 1735 195153 82 635 93487 94 5 42 1714 173510 85 470 64520 73 6 45 2496 153778 82 1022 93473 52 1 41 5501 455168 848 2068 114360 71 2 26 918 78800 57 330 33032 21 2 52 2228 208051 80 648 96125 155 0 47 3942 334657 116 1342 151911 174 10 45 2081 175523 68 868 89256 136 3 40 1816 213060 48 559 95671 128 0 4 496 24188 20 218 5950 7 0 44 2533 372238 81 833 149695 165 8 18 744 65029 21 255 32551 21 5 14 1161 101097 70 454 31701 35 3 37 3027 279012 125 1108 100087 137 1 56 2433 302218 80 642 169707 174 5 39 3576 323514 220 1079 150491 257 5 42 2606 339837 63 1046 120192 207 0 36 2175 252529 77 822 95893 103 12 46 3937 370483 65 1298 151715 171 10 28 3161 303406 146 1143 176225 279 12 43 2790 250858 72 1124 59900 83 11 42 2610 264889 59 931 104767 130 8 37 1426 228595 58 557 114799 131 2 30 1646 216027 58 436 72128 126 0 35 1867 188780 54 566 143592 158 6 44 2736 237856 89 832 89626 138 9 36 2277 232765 78 834 131072 200 2 28 1675 175699 62 621 126817 104 5 45 2537 239314 64 865 81351 111 13 23 893 73566 39 385 22618 26 6 45 2190 242585 58 716 88977 115 7 38 1694 187167 94 705 92059 127 2 38 1948 191920 61 683 81897 140 1 45 2314 359644 95 982 108146 121 4 36 2645 341637 48 1056 126372 183 3 41 1804 206059 50 522 249771 68 6 38 2250 201783 58 690 71154 112 2 37 1787 182231 67 644 71571 103 0 28 1678 153613 41 622 55918 63 1 45 4009 454794 114 1226 160141 166 0 26 1369 145943 45 653 38692 38 5 44 2306 280343 57 656 102812 163 2 8 870 80953 31 437 56622 59 0 27 1966 150216 175 822 15986 27 0 36 1338 156923 68 390 123534 108 6 37 3731 365448 278 1467 108535 88 1 57 2617 318651 91 907 93879 92 0 45 3085 179797 72 1044 144551 170 1 37 2312 251466 58 786 56750 98 1 38 2136 254506 71 655 127654 205 3 31 1808 185890 86 590 65594 96 9 36 2992 263577 89 1072 59938 107 1 36 2474 314255 134 947 146975 150 4 36 1624 189252 64 555 143372 123 3 35 1606 222504 72 552 168553 176 5 39 2091 285198 61 771 183500 213 0 65 3930 376927 130 1291 165986 208 12 30 3705 397681 73 1415 184923 307 13 51 2676 287015 83 846 140358 125 8 41 2296 285330 85 838 149959 208 0 36 1997 186856 116 640 57224 73 0 19 602 43287 43 214 43750 49 4 23 2146 185468 85 716 48029 82 4 40 2157 222268 72 755 104978 206 0 40 2549 259692 110 1140 100046 112 0 40 2649 301614 55 1030 101047 139 0 30 1110 121726 44 356 197426 60 0 41 3102 154165 79 906 160902 70 0 40 1861 306952 58 606 147172 112 4 45 2295 297982 70 684 109432 142 0 1 398 23623 9 156 1168 11 0 40 2205 195817 54 779 83248 130 0 11 530 61857 25 192 25162 31 4 45 1596 163766 107 457 45724 132 0 38 2949 384053 63 1162 110529 219 1 0 387 21054 2 146 855 4 0 30 2137 252805 67 866 101382 102 5 8 492 31961 22 200 14116 39 0 39 3397 311281 153 1211 89506 125 3 48 2089 240153 79 696 135356 121 7 48 1638 174892 112 485 116066 42 13 29 1685 152043 47 670 144244 111 3 8 568 38214 52 276 8773 16 0 43 1917 199336 113 662 102153 70 2 52 2759 353021 115 1010 117440 162 0 53 1288 196269 64 445 104128 173 0 48 3554 403932 134 1564 134238 171 4 48 2387 316105 120 820 134047 172 0 50 3328 396725 111 1151 279488 254 3 40 1250 187992 49 473 79756 90 0 36 1121 102424 55 401 66089 50 0 40 2867 284271 149 949 102070 113 4 46 4024 401260 155 1429 146760 187 4 40 1721 137843 104 534 154771 16 15 46 4061 383703 146 1698 165933 175 0 39 1830 157429 76 689 64593 90 4 41 1627 236370 83 528 92280 140 1 46 2535 282399 192 897 67150 145 1 32 1808 217478 69 610 128692 141 0 39 3873 366774 117 1548 124089 125 9 39 2181 236660 67 759 125386 241 1 21 2035 173260 37 716 37238 16 3 45 2960 323545 56 955 140015 175 11 50 1915 168994 122 720 150047 132 5 36 2604 246745 52 1011 154451 154 2 44 2633 301703 64 818 156349 198 1 0 2 1 0 0 0 0 9 0 207 14688 0 85 6023 5 0 0 5 98 0 0 0 0 0 0 8 455 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 37 2030 233143 58 699 84601 125 2 47 3179 372078 118 1052 68946 174 3 0 0 0 0 0 0 0 0 0 4 203 0 0 0 0 0 0 151 7199 0 74 1644 6 0 5 474 46660 7 259 6179 13 0 1 141 17547 3 69 3926 3 0 43 1047 116678 89 285 52789 35 0 0 29 969 0 0 0 0 0 32 1767 201582 48 582 100350 80 2
Names of X columns:
Revieuw Pagevieuws Time Compendiumvieuws_pr Coursecompendium CompendiumCharacters Hyperlinks shared
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