Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1418 3 79 30 146283 869 4 58 28 98364 1530 12 60 38 86146 2172 2 108 30 96933 901 1 49 22 79234 463 3 0 26 42551 3201 0 121 25 195663 371 0 1 18 6853 1192 0 20 11 21529 1583 5 43 26 95757 1439 0 69 25 85584 1764 0 78 38 143983 1495 7 86 44 75851 1373 7 44 30 59238 2187 3 104 40 93163 1491 9 63 34 96037 4041 0 158 47 151511 1706 4 102 30 136368 2152 3 77 31 112642 1036 0 82 23 94728 1882 7 115 36 105499 1929 0 101 36 121527 2242 1 80 30 127766 1220 5 50 25 98958 1289 7 83 39 77900 2515 0 123 34 85646 2147 0 73 31 98579 2352 5 81 31 130767 1638 0 105 33 131741 1222 0 47 25 53907 1812 0 105 33 178812 1677 3 94 35 146761 1579 4 44 42 82036 1731 1 114 43 163253 807 4 38 30 27032 2452 2 107 33 171975 829 0 30 13 65990 1940 0 71 32 86572 2662 0 84 36 159676 186 0 0 0 1929 1499 2 59 28 85371 865 1 33 14 58391 1793 0 42 17 31580 2527 2 96 32 136815 2747 10 106 30 120642 1324 6 56 35 69107 2702 0 57 20 50495 1383 5 59 28 108016 1179 4 39 28 46341 2099 1 34 39 78348 4308 2 76 34 79336 918 2 20 26 56968 1831 0 91 39 93176 3373 8 115 39 161632 1713 3 85 33 87850 1438 0 76 28 127969 496 0 8 4 15049 2253 8 79 39 155135 744 5 21 18 25109 1161 3 30 14 45824 2352 1 76 29 102996 2144 5 101 44 160604 4691 1 94 21 158051 1112 1 27 16 44547 2694 5 92 28 162647 1973 0 123 35 174141 1769 12 75 28 60622 3148 8 128 38 179566 2474 8 105 23 184301 2084 8 55 36 75661 1954 8 56 32 96144 1226 2 41 29 129847 1389 0 72 25 117286 1496 5 67 27 71180 2269 8 75 36 109377 1833 2 114 28 85298 1268 5 118 23 73631 1943 12 77 40 86767 893 6 22 23 23824 1762 7 66 40 93487 1403 2 69 28 82981 1425 0 105 34 73815 1857 4 116 33 94552 1840 3 88 28 132190 1502 6 73 34 128754 1441 2 99 30 66363 1420 0 62 33 67808 1416 1 53 22 61724 2970 0 118 38 131722 1317 5 30 26 68580 1644 2 100 35 106175 870 0 49 8 55792 1654 0 24 24 25157 1054 5 67 29 76669 937 0 46 20 57283 3004 1 57 29 105805 2008 0 75 45 129484 2547 1 135 37 72413 1885 1 68 33 87831 1626 2 124 33 96971 1468 6 33 25 71299 2445 1 98 32 77494 1964 4 58 29 120336 1381 2 68 28 93913 1369 3 81 28 136048 1659 0 131 31 181248 2888 10 110 52 146123 1290 0 37 21 32036 2845 9 130 24 186646 1982 7 93 41 102255 1904 0 118 33 168237 1391 0 39 32 64219 602 4 13 19 19630 1743 4 74 20 76825 1559 0 81 31 115338 2014 0 109 31 109427 2143 0 151 32 118168 2146 1 51 18 84845 874 0 28 23 153197 1590 1 40 17 29877 1590 0 56 20 63506 1210 0 27 12 22445 2072 4 37 17 47695 1281 0 83 30 68370 1401 4 54 31 146304 834 4 27 10 38233 1105 3 28 13 42071 1272 0 59 22 50517 1944 0 133 42 103950 391 0 12 1 5841 761 5 0 9 2341 1605 0 106 32 84396 530 4 23 11 24610 1988 0 44 25 35753 1386 0 71 36 55515 2395 1 116 31 209056 387 0 4 0 6622 1742 5 62 24 115814 620 0 12 13 11609 449 0 18 8 13155 800 0 14 13 18274 1684 0 60 19 72875 1050 0 7 18 10112 2699 2 98 33 142775 1606 7 64 40 68847 1502 1 29 22 17659 1204 8 32 38 20112 1138 2 25 24 61023 568 0 16 8 13983 1459 2 48 35 65176 2158 0 100 43 132432 1111 0 46 43 112494 1421 1 45 14 45109 2833 3 129 41 170875 1955 0 130 38 180759 2922 3 136 45 214921 1002 0 59 31 100226 1060 0 25 13 32043 956 0 32 28 54454 2186 4 63 31 78876 3604 4 95 40 170745 1035 11 14 30 6940 1417 0 36 16 49025 3261 0 113 37 122037 1587 4 47 30 53782 1424 0 92 35 127748 1701 1 70 32 86839 1249 0 19 27 44830 946 0 50 20 77395 1926 0 41 18 89324 3352 9 91 31 103300 1641 1 111 31 112283 2035 3 41 21 10901 2312 10 120 39 120691 1369 5 135 41 58106 1577 0 27 13 57140 2201 2 87 32 122422 961 0 25 18 25899 1900 1 131 39 139296 1254 2 45 14 52678 1335 4 29 7 23853 1597 0 58 17 17306 207 0 4 0 7953 1645 2 47 30 89455 2429 1 109 37 147866 151 0 7 0 4245 474 0 12 5 21509 141 0 0 1 7670 1639 1 37 16 66675 872 0 37 32 14336 1318 2 46 24 53608 1018 0 15 17 30059 1383 3 42 11 29668 1314 6 7 24 22097 1335 0 54 22 96841 1403 2 54 12 41907 910 0 14 19 27080 616 2 16 13 35885 1407 1 33 17 41247 771 1 32 15 28313 766 2 21 16 36845 473 1 15 24 16548 1376 0 38 15 36134 1232 1 22 17 55764 1521 3 28 18 28910 572 0 10 20 13339 1059 0 31 16 25319 1544 0 32 16 66956 1230 0 32 18 47487 1206 1 43 22 52785 1205 4 27 8 44683 1255 0 37 17 35619 613 0 20 18 21920 721 0 32 16 45608 1109 7 0 23 7721 740 2 5 22 20634 1126 0 26 13 29788 728 7 10 13 31931 689 3 27 16 37754 592 0 11 16 32505 995 0 29 20 40557 1613 6 25 22 94238 2048 2 55 17 44197 705 0 23 18 43228 301 0 5 17 4103 1803 3 43 12 44144 799 0 23 7 32868 861 1 34 17 27640 1186 1 36 14 14063 1451 0 35 23 28990 628 1 0 17 4694 1161 0 37 14 42648 1463 0 28 15 64329 742 0 16 17 21928 979 0 26 21 25836 675 0 38 18 22779 1241 0 23 18 40820 676 0 22 17 27530 1049 0 30 17 32378 620 0 16 16 10824 1081 0 18 15 39613 1688 0 28 21 60865 736 0 32 16 19787 617 2 21 14 20107 812 0 23 15 36605 1051 1 29 17 40961 1656 1 50 15 48231 705 0 12 15 39725 945 0 21 10 21455 554 0 18 6 23430 1597 0 27 22 62991 982 0 41 21 49363 222 0 13 1 9604 1212 1 12 18 24552 1143 0 21 17 31493 435 0 8 4 3439 532 0 26 10 19555 882 0 27 16 21228 608 1 13 16 23177 459 0 16 9 22094 578 0 2 16 2342 826 0 42 17 38798 509 0 5 7 3255 717 0 37 15 24261 637 0 17 14 18511 857 0 38 14 40798 830 0 37 18 28893 652 0 29 12 21425 707 0 32 16 50276 954 0 35 21 37643 1461 1 17 19 30377 672 0 20 16 27126 778 0 7 1 13 1141 1 46 16 42097 680 0 24 10 24451 1090 6 40 19 14335 616 3 3 12 5084 285 1 10 2 9927 1145 2 37 14 43527 733 0 17 17 27184 888 0 28 19 21610 849 0 19 14 20484 1182 3 29 11 20156 528 1 8 4 6012 642 0 10 16 18475 947 0 15 20 12645 819 1 15 12 11017 757 0 28 15 37623 894 0 17 16 35873
Names of X columns:
PV SC BC CR TS
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