Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
14 501 11 20 91.81 77585 1303.2 14 485 11 19 91.98 77585 -58.7 15 464 11 18 91.72 77585 -378.9 13 460 11 13 90.27 78302 175.6 8 467 11 17 91.89 78302 233.7 7 460 9 17 92.07 78302 706.8 3 448 8 13 92.92 78224 -23.6 3 443 6 14 93.34 78224 420.9 4 436 7 13 93.6 78224 722.1 4 431 8 17 92.41 78178 1401.3 0 484 6 17 93.6 78178 -94.9 -4 510 5 15 93.77 78178 1043.6 -14 513 2 9 93.6 77988 1300.1 -18 503 3 10 93.6 77988 721.1 -8 471 3 9 93.51 77988 -45.6 -1 471 7 14 92.66 77876 787.5 1 476 8 18 94.2 77876 694.3 2 475 7 18 94.37 77876 1054.7 0 470 7 12 94.45 78432 821.9 1 461 6 16 94.62 78432 1100.7 0 455 6 12 94.37 78432 862.4 -1 456 7 19 93.43 79025 1656.1 -3 517 5 13 94.79 79025 -174 -3 525 5 12 94.88 79025 1337.6 -3 523 5 13 94.79 79407 1394.9 -4 519 4 11 94.62 79407 915.7 -8 509 4 10 94.71 79407 -481.1 -9 512 4 16 93.77 79644 167.9 -13 519 1 12 95.73 79644 208.2 -18 517 -1 6 95.99 79644 382.2 -11 510 3 8 95.82 79381 1004 -9 509 4 6 95.47 79381 864.7 -10 501 3 8 95.82 79381 1052.9 -13 507 2 8 94.71 79536 1417.6 -11 569 1 9 96.33 79536 -197.7 -5 580 4 13 96.5 79536 1262.1 -15 578 3 8 96.16 79813 1147.2 -6 565 5 11 96.33 79813 700.2 -6 547 6 8 96.33 79813 45.3 -3 555 6 10 95.05 80332 458.5 -1 562 6 15 96.84 80332 610.2 -3 561 6 12 96.92 80332 786.4 -4 555 6 13 97.44 81434 787.2 -6 544 5 12 97.78 81434 1040 0 537 6 15 97.69 81434 324.1 -4 543 5 13 96.67 82167 1343 -2 594 6 13 98.29 82167 -501.2 -2 611 5 16 98.2 82167 800.4 -6 613 7 14 98.71 82816 916.7 -7 611 4 12 98.54 82816 695.8 -6 594 5 15 98.2 82816 28 -6 595 6 14 96.92 83000 495.6 -3 591 6 19 99.06 83000 366.2 -2 589 5 16 99.65 83000 633 -5 584 3 16 99.82 83251 848.3 -11 573 2 11 99.99 83251 472.2 -11 567 3 13 100.33 83251 357.8 -11 569 3 12 99.31 83591 824.3 -10 621 2 11 101.1 83591 -880.1 -14 629 0 6 101.1 83591 1066.8 -8 628 4 9 100.93 83910 1052.8 -9 612 4 6 100.85 83910 -32.1 -5 595 5 15 100.93 83910 -1331.4 -1 597 6 17 99.6 84599 -767.1 -2 593 6 13 101.88 84599 -236.7 -5 590 5 12 101.81 84599 -184.9 -4 580 5 13 102.38 85275 -143.4 -6 574 3 10 102.74 85275 493.9 -2 573 5 14 102.82 85275 549.7 -2 573 5 13 101.72 85608 982.7 -2 620 5 10 103.47 85608 -856.3 -2 626 3 11 102.98 85608 967 2 620 6 12 102.68 86303 659.4 1 588 6 7 102.9 86303 577.2 -8 566 4 11 103.03 86303 -213.1 -1 557 6 9 101.29 87115 17.7 1 561 5 13 103.69 87115 390.1 -1 549 4 12 103.68 87115 509.3 2 532 5 5 104.2 87931 410 2 526 5 13 104.08 87931 212.5 1 511 4 11 104.16 87931 818 -1 499 3 8 103.05 88164 422.7 -2 555 2 8 104.66 88164 -158 -2 565 3 8 104.46 88164 427.2 -1 542 2 8 104.95 88792 243.4 -8 527 -1 0 105.85 88792 -419.3 -4 510 0 3 106.23 88792 -1459.8 -6 514 -2 0 104.86 89263 -1389.8 -3 517 1 -1 107.44 89263 -2.1 -3 508 -2 -1 108.23 89263 -938.6 -7 493 -2 -4 108.45 89881 -839.9 -9 490 -2 1 109.39 89881 -297.6 -11 469 -6 -1 110.15 89881 -376.3 -13 478 -4 0 109.13 90120 -79.4 -11 528 -2 -1 110.28 90120 -2091.3 -9 534 0 6 110.17 90120 -1023 -17 518 -5 0 109.99 89703 -765.6 -22 506 -4 -3 109.26 89703 -1592.3 -25 502 -5 -3 109.11 89703 -1588.8 -20 516 -1 4 107.06 87818 -1318 -24 528 -2 1 109.53 87818 -402.4 -24 533 -4 0 108.92 87818 -814.5 -22 536 -1 -4 109.24 86273 -98.4 -19 537 1 -2 109.12 86273 -305.9 -18 524 1 3 109 86273 -18.4 -17 536 -2 2 107.23 86316 610.3 -11 587 1 5 109.49 86316 -917.3 -11 597 1 6 109.04 86316 88.4 -12 581 3 6 109.02 87234 -740.2 -10 564 3 3 109.23 87234 29.3 -15 558 1 4 109.46 87234 -893.2 -15 575 1 7 107.9 87885 -1030.2 -15 580 0 5 110.42 87885 -403.4 -13 575 2 6 110.98 87885 -46.9 -8 563 2 1 111.48 88003 -321.2 -13 552 -1 3 111.88 88003 -239.9 -9 537 1 6 111.89 88003 640.9 -7 545 0 0 109.85 88910 511.6 -4 601 1 3 112.1 88910 -665.1 -4 604 1 4 112.24 88910 657.7 -2 586 3 7 112.39 89397 -207.7 0 564 2 6 112.52 89397 -885.2 -2 549 0 6 113.16 89397 -1595.8 -3 551 0 6 111.84 89813 -1374.9 1 556 3 6 114.33 89813 -316.6 -2 548 -2 2 114.82 89813 -283.4 -1 540 0 2 115.2 90539 -175.8 1 531 1 2 115.4 90539 -694.2 -3 521 -1 3 115.74 90539 -249.9 -4 519 -2 -1 114.19 90688 268.2 -9 572 -1 -4 115.94 90688 -2105.1 -9 581 -1 4 116.03 90688 -762.8 -7 563 1 5 116.24 90691 -117.1 -14 548 -2 3 116.66 90691 -1094.4 -12 539 -5 -1 116.79 90691 -2095.2 -16 541 -5 -4 115.48 90645 -1587.6 -20 562 -6 0 118.16 90645 -528 -12 559 -4 -1 118.38 90645 -324.2 -12 546 -3 -1 118.51 90861 -276.1 -10 536 -3 3 118.42 90861 -139.1 -10 528 -1 2 118.24 90861 268 -13 530 -2 -4 116.47 90401 570.5 -16 582 -3 -3 118.96 90401 -316.5
Names of X columns:
i w f s c b h
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
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation