Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
14 501 11 20 91.81 77585 1303.2 2000 183620 14 485 11 19 91.98 77585 -58.7 2000 183960 15 464 11 18 91.72 77585 -378.9 2000 183440 13 460 11 13 90.27 78302 175.6 2001 180630.27 8 467 11 17 91.89 78302 233.7 2001 183871.89 7 460 9 17 92.07 78302 706.8 2001 184232.07 3 448 8 13 92.92 78224 -23.6 2001 185932.92 3 443 6 14 93.34 78224 420.9 2001 186773.34 4 436 7 13 93.6 78224 722.1 2001 187293.6 4 431 8 17 92.41 78178 1401.3 2001 184912.41 0 484 6 17 93.6 78178 -94.9 2001 187293.6 -4 510 5 15 93.77 78178 1043.6 2001 187633.77 -14 513 2 9 93.6 77988 1300.1 2001 187293.6 -18 503 3 10 93.6 77988 721.1 2001 187293.6 -8 471 3 9 93.51 77988 -45.6 2001 187113.51 -1 471 7 14 92.66 77876 787.5 2002 185505.32 1 476 8 18 94.2 77876 694.3 2002 188588.4 2 475 7 18 94.37 77876 1054.7 2002 188928.74 0 470 7 12 94.45 78432 821.9 2002 189088.9 1 461 6 16 94.62 78432 1100.7 2002 189429.24 0 455 6 12 94.37 78432 862.4 2002 188928.74 -1 456 7 19 93.43 79025 1656.1 2002 187046.86 -3 517 5 13 94.79 79025 -174 2002 189769.58 -3 525 5 12 94.88 79025 1337.6 2002 189949.76 -3 523 5 13 94.79 79407 1394.9 2002 189769.58 -4 519 4 11 94.62 79407 915.7 2002 189429.24 -8 509 4 10 94.71 79407 -481.1 2002 189609.42 -9 512 4 16 93.77 79644 167.9 2003 187821.31 -13 519 1 12 95.73 79644 208.2 2003 191747.19 -18 517 -1 6 95.99 79644 382.2 2003 192267.97 -11 510 3 8 95.82 79381 1004 2003 191927.46 -9 509 4 6 95.47 79381 864.7 2003 191226.41 -10 501 3 8 95.82 79381 1052.9 2003 191927.46 -13 507 2 8 94.71 79536 1417.6 2003 189704.13 -11 569 1 9 96.33 79536 -197.7 2003 192948.99 -5 580 4 13 96.5 79536 1262.1 2003 193289.5 -15 578 3 8 96.16 79813 1147.2 2003 192608.48 -6 565 5 11 96.33 79813 700.2 2003 192948.99 -6 547 6 8 96.33 79813 45.3 2003 192948.99 -3 555 6 10 95.05 80332 458.5 2004 190480.2 -1 562 6 15 96.84 80332 610.2 2004 194067.36 -3 561 6 12 96.92 80332 786.4 2004 194227.68 -4 555 6 13 97.44 81434 787.2 2004 195269.76 -6 544 5 12 97.78 81434 1040 2004 195951.12 0 537 6 15 97.69 81434 324.1 2004 195770.76 -4 543 5 13 96.67 82167 1343 2004 193726.68 -2 594 6 13 98.29 82167 -501.2 2004 196973.16 -2 611 5 16 98.2 82167 800.4 2004 196792.8 -6 613 7 14 98.71 82816 916.7 2004 197814.84 -7 611 4 12 98.54 82816 695.8 2004 197474.16 -6 594 5 15 98.2 82816 28 2004 196792.8 -6 595 6 14 96.92 83000 495.6 2005 194324.6 -3 591 6 19 99.06 83000 366.2 2005 198615.3 -2 589 5 16 99.65 83000 633 2005 199798.25 -5 584 3 16 99.82 83251 848.3 2005 200139.1 -11 573 2 11 99.99 83251 472.2 2005 200479.95 -11 567 3 13 100.33 83251 357.8 2005 201161.65 -11 569 3 12 99.31 83591 824.3 2005 199116.55 -10 621 2 11 101.1 83591 -880.1 2005 202705.5 -14 629 0 6 101.1 83591 1066.8 2005 202705.5 -8 628 4 9 100.93 83910 1052.8 2005 202364.65 -9 612 4 6 100.85 83910 -32.1 2005 202204.25 -5 595 5 15 100.93 83910 -1331.4 2005 202364.65 -1 597 6 17 99.6 84599 -767.1 2006 199797.6 -2 593 6 13 101.88 84599 -236.7 2006 204371.28 -5 590 5 12 101.81 84599 -184.9 2006 204230.86 -4 580 5 13 102.38 85275 -143.4 2006 205374.28 -6 574 3 10 102.74 85275 493.9 2006 206096.44 -2 573 5 14 102.82 85275 549.7 2006 206256.92 -2 573 5 13 101.72 85608 982.7 2006 204050.32 -2 620 5 10 103.47 85608 -856.3 2006 207560.82 -2 626 3 11 102.98 85608 967 2006 206577.88 2 620 6 12 102.68 86303 659.4 2006 205976.08 1 588 6 7 102.9 86303 577.2 2006 206417.4 -8 566 4 11 103.03 86303 -213.1 2006 206678.18 -1 557 6 9 101.29 87115 17.7 2007 203289.03 1 561 5 13 103.69 87115 390.1 2007 208105.83 -1 549 4 12 103.68 87115 509.3 2007 208085.76 2 532 5 5 104.2 87931 410 2007 209129.4 2 526 5 13 104.08 87931 212.5 2007 208888.56 1 511 4 11 104.16 87931 818 2007 209049.12 -1 499 3 8 103.05 88164 422.7 2007 206821.35 -2 555 2 8 104.66 88164 -158 2007 210052.62 -2 565 3 8 104.46 88164 427.2 2007 209651.22 -1 542 2 8 104.95 88792 243.4 2007 210634.65 -8 527 -1 0 105.85 88792 -419.3 2007 212440.95 -4 510 0 3 106.23 88792 -1459.8 2007 213203.61 -6 514 -2 0 104.86 89263 -1389.8 2008 210558.88 -3 517 1 -1 107.44 89263 -2.1 2008 215739.52 -3 508 -2 -1 108.23 89263 -938.6 2008 217325.84 -7 493 -2 -4 108.45 89881 -839.9 2008 217767.6 -9 490 -2 1 109.39 89881 -297.6 2008 219655.12 -11 469 -6 -1 110.15 89881 -376.3 2008 221181.2 -13 478 -4 0 109.13 90120 -79.4 2008 219133.04 -11 528 -2 -1 110.28 90120 -2091.3 2008 221442.24 -9 534 0 6 110.17 90120 -1023 2008 221221.36 -17 518 -5 0 109.99 89703 -765.6 2008 220859.92 -22 506 -4 -3 109.26 89703 -1592.3 2008 219394.08 -25 502 -5 -3 109.11 89703 -1588.8 2008 219092.88 -20 516 -1 4 107.06 87818 -1318 2009 215083.54 -24 528 -2 1 109.53 87818 -402.4 2009 220045.77 -24 533 -4 0 108.92 87818 -814.5 2009 218820.28 -22 536 -1 -4 109.24 86273 -98.4 2009 219463.16 -19 537 1 -2 109.12 86273 -305.9 2009 219222.08 -18 524 1 3 109 86273 -18.4 2009 218981 -17 536 -2 2 107.23 86316 610.3 2009 215425.07 -11 587 1 5 109.49 86316 -917.3 2009 219965.41 -11 597 1 6 109.04 86316 88.4 2009 219061.36 -12 581 3 6 109.02 87234 -740.2 2009 219021.18 -10 564 3 3 109.23 87234 29.3 2009 219443.07 -15 558 1 4 109.46 87234 -893.2 2009 219905.14 -15 575 1 7 107.9 87885 -1030.2 2010 216879 -15 580 0 5 110.42 87885 -403.4 2010 221944.2 -13 575 2 6 110.98 87885 -46.9 2010 223069.8 -8 563 2 1 111.48 88003 -321.2 2010 224074.8 -13 552 -1 3 111.88 88003 -239.9 2010 224878.8 -9 537 1 6 111.89 88003 640.9 2010 224898.9 -7 545 0 0 109.85 88910 511.6 2010 220798.5 -4 601 1 3 112.1 88910 -665.1 2010 225321 -4 604 1 4 112.24 88910 657.7 2010 225602.4 -2 586 3 7 112.39 89397 -207.7 2010 225903.9 0 564 2 6 112.52 89397 -885.2 2010 226165.2 -2 549 0 6 113.16 89397 -1595.8 2010 227451.6 -3 551 0 6 111.84 89813 -1374.9 2011 224910.24 1 556 3 6 114.33 89813 -316.6 2011 229917.63 -2 548 -2 2 114.82 89813 -283.4 2011 230903.02 -1 540 0 2 115.2 90539 -175.8 2011 231667.2 1 531 1 2 115.4 90539 -694.2 2011 232069.4 -3 521 -1 3 115.74 90539 -249.9 2011 232753.14 -4 519 -2 -1 114.19 90688 268.2 2011 229636.09 -9 572 -1 -4 115.94 90688 -2105.1 2011 233155.34 -9 581 -1 4 116.03 90688 -762.8 2011 233336.33 -7 563 1 5 116.24 90691 -117.1 2011 233758.64 -14 548 -2 3 116.66 90691 -1094.4 2011 234603.26 -12 539 -5 -1 116.79 90691 -2095.2 2011 234864.69 -16 541 -5 -4 115.48 90645 -1587.6 2012 232345.76 -20 562 -6 0 118.16 90645 -528 2012 237737.92 -12 559 -4 -1 118.38 90645 -324.2 2012 238180.56 -12 546 -3 -1 118.51 90861 -276.1 2012 238442.12 -10 536 -3 3 118.42 90861 -139.1 2012 238261.04 -10 528 -1 2 118.24 90861 268 2012 237898.88 -13 530 -2 -4 116.47 90401 570.5 2012 234337.64 -16 582 -3 -3 118.96 90401 -316.5 2012 239347.52
Names of X columns:
i w f s c b h t c_t
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