Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
140824 186099 165 0 474 38 144 83899 110459 113854 132 3 421 34 133 62711 105079 99776 121 0 673 42 162 122597 112098 106194 145 3 1137 38 148 112249 43929 100792 71 2 333 27 88 56414 76173 47552 47 2 179 35 129 23297 187326 250931 177 8 2146 33 128 231677 22807 6853 5 0 111 18 67 26333 144408 115466 124 1 735 34 132 92356 66485 110896 92 1 585 33 120 100802 79089 169351 149 5 754 42 155 123523 81625 94853 93 5 650 55 210 141038 68788 72591 70 0 615 35 115 84032 103297 101345 148 0 1117 52 179 242821 69446 113713 100 0 599 42 158 98074 114948 165354 142 8 1638 59 223 204399 167949 164263 194 3 724 36 140 127837 125081 135213 113 1 1139 39 144 179805 125818 111669 162 7 491 29 111 57017 136588 134163 186 14 675 46 179 121853 112431 140303 147 1 819 45 171 128937 103037 150773 137 3 1203 39 144 274771 82317 111848 71 3 421 25 89 50114 118906 102509 123 5 601 52 208 87388 83515 96785 134 6 1156 41 153 103760 104581 116136 115 1 923 38 146 87587 103129 158376 138 9 1061 41 158 108822 83243 153990 125 7 593 39 142 109222 37110 64057 66 4 559 32 117 91858 113344 230054 137 7 1016 41 158 96751 139165 184531 152 3 886 45 175 87130 86652 114198 159 6 605 47 174 82994 112302 198299 159 2 779 48 185 120264 69652 33750 31 0 310 37 141 63967 119442 189723 185 14 1135 39 151 157208 69867 100826 78 0 1186 42 159 173124 101629 188355 117 4 1287 41 151 223454 70168 104470 109 3 585 36 139 103722 31081 58391 41 0 276 17 55 57078 103925 164808 149 9 1139 39 151 163531 92622 134097 123 0 1490 39 145 190081 79011 80238 103 1 590 38 138 77659 93487 133252 87 7 632 36 115 59631 64520 54518 71 2 464 42 157 118932 93473 121850 51 1 1022 45 73 31928 114360 79367 70 1 2005 38 138 366195 33032 56968 21 0 330 26 82 21832 96125 106314 155 0 648 52 201 101737 151911 191889 172 2 1305 47 181 131263 89256 104864 133 3 868 45 164 70659 95671 160791 125 3 554 40 158 52259 5950 15049 7 0 218 4 12 9139 149695 191179 158 7 832 44 163 181046 32551 25109 21 0 255 18 67 39920 31701 45824 35 0 454 14 52 55273 100087 129711 133 4 1074 37 134 139882 169707 210012 169 5 642 56 210 92206 150491 194679 256 1 1057 36 134 121210 120192 197680 190 17 992 41 150 124866 95893 81180 100 3 814 36 139 165693 151715 197765 171 0 1288 46 178 162900 176225 214738 267 12 1128 28 101 81448 59900 96252 80 3 1061 42 165 136139 104767 124527 126 4 897 42 163 130023 114799 153242 132 -1 557 37 139 75353 72128 145707 121 5 436 30 116 70320 143592 113963 156 2 562 35 137 73996 89626 134904 133 5 799 44 167 92795 131072 114268 199 1 826 36 135 115430 126817 94333 98 6 600 28 102 72458 81351 102204 109 2 863 45 173 137073 22618 23824 25 1 385 23 88 49742 88977 111563 113 2 712 45 175 130935 92059 91313 126 1 705 38 133 95854 81897 89770 137 3 606 38 148 88511 108146 100125 121 0 965 42 157 248935 126372 165278 178 5 992 36 140 157848 249771 181712 63 5 522 41 154 24347 71154 80906 109 3 648 38 148 104064 71571 75881 101 2 588 37 134 93109 55918 83963 61 2 622 28 109 69650 160141 175721 157 9 1197 45 175 253760 38692 68580 38 0 651 26 99 77339 102812 136323 159 4 656 44 122 144020 56622 55792 58 1 437 8 28 25161 15986 25157 27 0 792 27 101 122949 123534 100922 108 0 342 35 129 45855 108535 118845 83 5 1353 37 143 217209 93879 170492 88 4 891 57 206 136994 144551 81716 164 6 1038 41 155 96779 56750 115750 96 2 786 37 138 135716 127654 105590 192 13 618 38 141 125371 65594 92795 94 2 545 31 114 82449 59938 82390 107 0 1061 36 140 179104 146975 135599 144 6 928 36 140 166284 143372 111542 123 0 555 36 140 77710 168553 162519 170 6 552 35 127 59985 183500 211381 210 3 741 39 141 66789 165986 189944 193 15 1251 58 223 177779 184923 226168 297 10 1389 30 114 166178 140358 117495 125 0 833 51 198 167160 149959 195894 204 4 812 41 155 77748 57224 80684 70 3 640 36 138 106172 43750 19630 49 0 214 19 71 23657 48029 88634 82 0 713 23 84 96668 104978 139292 205 1 686 40 151 63796 100046 128602 111 1 1140 40 155 131090 101047 135848 135 4 1028 40 150 165608 197426 178377 59 1 349 30 112 -58408 160902 106330 70 0 892 41 161 46698 147172 178303 108 4 606 40 149 128649 109432 116938 141 1 682 45 164 180869 1168 5841 11 0 156 1 0 17782 83248 106020 130 0 656 36 139 69512 25162 24610 28 3 192 11 32 37247 45724 74151 101 31 457 45 169 89615 110529 232241 216 3 1162 38 140 151812 855 6622 4 0 146 0 0 14432 101382 127097 97 5 866 30 111 125708 14116 13155 39 0 200 8 25 18806 89506 160501 119 6 1163 39 146 134108 135356 91502 118 3 693 46 175 143567 116066 24469 41 1 485 48 181 150393 144244 88229 107 4 670 29 107 63814 8773 13983 16 0 276 8 27 24231 102153 80716 69 1 646 39 147 108735 117440 157384 160 2 993 47 178 187418 104128 122975 158 15 441 50 193 67968 134238 191469 161 10 1548 48 187 204691 134047 231257 165 7 819 48 187 82955 279488 258287 246 8 1151 50 186 138425 79756 122531 89 1 473 40 151 65461 66089 61394 49 1 401 36 131 41030 102070 86480 107 6 943 40 155 196912 146760 195791 182 5 1429 46 172 205469 154771 18284 16 0 529 39 148 117652 165933 147581 173 2 1654 42 156 225565 64593 72558 90 0 689 39 143 84871 92280 147341 140 0 528 41 151 89029 67150 114651 142 3 873 42 145 144308 128692 100187 126 15 601 32 125 114151 124089 130332 123 2 1545 39 145 232822 125386 134218 239 2 747 36 133 98121 37238 10901 15 1 716 21 79 162359 140015 145758 170 5 940 45 174 171918 150047 75767 123 9 720 50 192 93227 154451 134969 151 3 980 36 132 98324 156349 169216 194 4 815 44 159 132369 0 0 0 0 0 0 0 1 6023 7953 5 0 85 0 0 6735 0 0 0 0 0 0 0 98 0 0 0 0 0 0 0 455 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 84601 105406 122 3 662 37 133 111397 68946 174586 173 1 1041 47 185 190644 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 203 1644 4245 6 0 74 0 0 2954 6179 21509 13 0 259 5 15 25151 3926 7670 3 0 69 1 4 9877 52789 15673 35 0 285 43 152 101005 0 0 0 0 0 0 0 969 100350 75882 72 8 573 31 113 119710
Names of X columns:
Y X1 X2 X3 X4 X5 X6 X7
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