Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
112285 1418 210907 30 84786 869 120982 28 83123 1530 176508 38 101193 2172 179321 30 38361 901 123185 22 68504 463 52746 26 119182 3201 385534 25 22807 371 33170 18 17140 1192 101645 11 116174 1583 149061 26 57635 1439 165446 25 66198 1764 237213 38 71701 1495 173326 44 57793 1373 133131 30 80444 2187 258873 40 53855 1491 180083 34 97668 4041 324799 47 133824 1706 230964 30 101481 2152 236785 31 99645 1036 135473 23 114789 1882 202925 36 99052 1929 215147 36 67654 2242 344297 30 65553 1220 153935 25 97500 1289 132943 39 69112 2515 174724 34 82753 2147 174415 31 85323 2352 225548 31 72654 1638 223632 33 30727 1222 124817 25 77873 1812 221698 33 117478 1677 210767 35 74007 1579 170266 42 90183 1731 260561 43 61542 807 84853 30 101494 2452 294424 33 27570 829 101011 13 55813 1940 215641 32 79215 2662 325107 36 1423 186 7176 0 55461 1499 167542 28 31081 865 106408 14 22996 1793 96560 17 83122 2527 265769 32 70106 2747 269651 30 60578 1324 149112 35 39992 2702 175824 20 79892 1383 152871 28 49810 1179 111665 28 71570 2099 116408 39 100708 4308 362301 34 33032 918 78800 26 82875 1831 183167 39 139077 3373 277965 39 71595 1713 150629 33 72260 1438 168809 28 5950 496 24188 4 115762 2253 329267 39 32551 744 65029 18 31701 1161 101097 14 80670 2352 218946 29 143558 2144 244052 44 117105 4691 341570 21 23789 1112 103597 16 120733 2694 233328 28 105195 1973 256462 35 73107 1769 206161 28 132068 3148 311473 38 149193 2474 235800 23 46821 2084 177939 36 87011 1954 207176 32 95260 1226 196553 29 55183 1389 174184 25 106671 1496 143246 27 73511 2269 187559 36 92945 1833 187681 28 78664 1268 119016 23 70054 1943 182192 40 22618 893 73566 23 74011 1762 194979 40 83737 1403 167488 28 69094 1425 143756 34 93133 1857 275541 33 95536 1840 243199 28 225920 1502 182999 34 62133 1441 135649 30 61370 1420 152299 33 43836 1416 120221 22 106117 2970 346485 38 38692 1317 145790 26 84651 1644 193339 35 56622 870 80953 8 15986 1654 122774 24 95364 1054 130585 29 26706 937 112611 20 89691 3004 286468 29 67267 2008 241066 45 126846 2547 148446 37 41140 1885 204713 33 102860 1626 182079 33 51715 1468 140344 25 55801 2445 220516 32 111813 1964 243060 29 120293 1381 162765 28 138599 1369 182613 28 161647 1659 232138 31 115929 2888 265318 52 24266 1290 85574 21 162901 2845 310839 24 109825 1982 225060 41 129838 1904 232317 33 37510 1391 144966 32 43750 602 43287 19 40652 1743 155754 20 87771 1559 164709 31 85872 2014 201940 31 89275 2143 235454 32 44418 2146 220801 18 192565 874 99466 23 35232 1590 92661 17 40909 1590 133328 20 13294 1210 61361 12 32387 2072 125930 17 140867 1281 100750 30 120662 1401 224549 31 21233 834 82316 10 44332 1105 102010 13 61056 1272 101523 22 101338 1944 243511 42 1168 391 22938 1 13497 761 41566 9 65567 1605 152474 32 25162 530 61857 11 32334 1988 99923 25 40735 1386 132487 36 91413 2395 317394 31 855 387 21054 0 97068 1742 209641 24 44339 620 22648 13 14116 449 31414 8 10288 800 46698 13 65622 1684 131698 19 16563 1050 91735 18 76643 2699 244749 33 110681 1606 184510 40 29011 1502 79863 22 92696 1204 128423 38 94785 1138 97839 24 8773 568 38214 8 83209 1459 151101 35 93815 2158 272458 43 86687 1111 172494 43 34553 1421 108043 14 105547 2833 328107 41 103487 1955 250579 38 213688 2922 351067 45 71220 1002 158015 31 23517 1060 98866 13 56926 956 85439 28 91721 2186 229242 31 115168 3604 351619 40 111194 1035 84207 30 51009 1417 120445 16 135777 3261 324598 37 51513 1587 131069 30 74163 1424 204271 35 51633 1701 165543 32 75345 1249 141722 27 33416 946 116048 20 83305 1926 250047 18 98952 3352 299775 31 102372 1641 195838 31 37238 2035 173260 21 103772 2312 254488 39 123969 1369 104389 41 27142 1577 136084 13 135400 2201 199476 32 21399 961 92499 18 130115 1900 224330 39 24874 1254 135781 14 34988 1335 74408 7 45549 1597 81240 17 6023 207 14688 0 64466 1645 181633 30 54990 2429 271856 37 1644 151 7199 0 6179 474 46660 5 3926 141 17547 1 32755 1639 133368 16 34777 872 95227 32 73224 1318 152601 24 27114 1018 98146 17 20760 1383 79619 11 37636 1314 59194 24 65461 1335 139942 22 30080 1403 118612 12 24094 910 72880 19 69008 616 65475 13 54968 1407 99643 17 46090 771 71965 15 27507 766 77272 16 10672 473 49289 24 34029 1376 135131 15 46300 1232 108446 17 24760 1521 89746 18 18779 572 44296 20 21280 1059 77648 16 40662 1544 181528 16 28987 1230 134019 18 22827 1206 124064 22 18513 1205 92630 8 30594 1255 121848 17 24006 613 52915 18 27913 721 81872 16 42744 1109 58981 23 12934 740 53515 22 22574 1126 60812 13 41385 728 56375 13 18653 689 65490 16 18472 592 80949 16 30976 995 76302 20 63339 1613 104011 22 25568 2048 98104 17 33747 705 67989 18 4154 301 30989 17 19474 1803 135458 12 35130 799 73504 7 39067 861 63123 17 13310 1186 61254 14 65892 1451 74914 23 4143 628 31774 17 28579 1161 81437 14 51776 1463 87186 15 21152 742 50090 17 38084 979 65745 21 27717 675 56653 18 32928 1241 158399 18 11342 676 46455 17 19499 1049 73624 17 16380 620 38395 16 36874 1081 91899 15 48259 1688 139526 21 16734 736 52164 16 28207 617 51567 14 30143 812 70551 15 41369 1051 84856 17 45833 1656 102538 15 29156 705 86678 15 35944 945 85709 10 36278 554 34662 6 45588 1597 150580 22 45097 982 99611 21 3895 222 19349 1 28394 1212 99373 18 18632 1143 86230 17 2325 435 30837 4 25139 532 31706 10 27975 882 89806 16 14483 608 62088 16 13127 459 40151 9 5839 578 27634 16 24069 826 76990 17 3738 509 37460 7 18625 717 54157 15 36341 637 49862 14 24548 857 84337 14 21792 830 64175 18 26263 652 59382 12 23686 707 119308 16 49303 954 76702 21 25659 1461 103425 19 28904 672 70344 16 2781 778 43410 1 29236 1141 104838 16 19546 680 62215 10 22818 1090 69304 19 32689 616 53117 12 5752 285 19764 2 22197 1145 86680 14 20055 733 84105 17 25272 888 77945 19 82206 849 89113 14 32073 1182 91005 11 5444 528 40248 4 20154 642 64187 16 36944 947 50857 20 8019 819 56613 12 30884 757 62792 15 19540 894 72535 16
Names of X columns:
Writing Pageviews TimeRFC Reviews
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