Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
162556 213118 6282929 29790 81767 4324047 87550 153198 4108272 84738 -26007 -1212617 54660 126942 1485329 42634 157214 1779876 40949 129352 1367203 45187 234817 2519076 37704 60448 912684 16275 47818 1443586 25830 245546 1220017 12679 48020 984885 18014 -1710 1457425 43556 32648 -572920 24811 95350 929144 6575 151352 1151176 7123 288170 790090 21950 114337 774497 37597 37884 990576 17821 122844 454195 12988 82340 876607 22330 79801 711969 13326 165548 702380 16189 116384 264449 7146 134028 450033 15824 63838 541063 27664 74996 588864 11920 31080 -37216 8568 32168 783310 14416 49857 467359 3369 87161 688779 11819 106113 608419 6984 80570 696348 4519 102129 597793 2220 301670 821730 18562 102313 377934 10327 88577 651939 5336 112477 697458 2365 191778 700368 4069 79804 225986 8636 128294 348695 13718 96448 373683 4525 93811 501709 6869 117520 413743 4628 69159 379825 3689 101792 336260 4891 210568 636765 7489 136996 481231 4901 121920 469107 2284 76403 211928 3160 108094 563925 4150 134759 511939 7285 188873 521016 1134 146216 543856 4658 156608 329304 2384 61348 423262 3748 50350 509665 5371 87720 455881 1285 99489 367772 9327 87419 406339 5565 94355 493408 1528 60326 232942 3122 94670 416002 7561 82425 337430 2675 59017 361517 13253 90829 360962 880 80791 235561 2053 100423 408247 1424 131116 450296 4036 100269 418799 3045 27330 247405 5119 39039 378519 1431 106885 326638 554 79285 328233 1975 118881 386225 1765 77623 283662 1012 114768 370225 810 74015 269236 1280 69465 365732 666 117869 420383 1380 60982 345811 4677 90131 431809 876 138971 418876 814 39625 297476 514 102725 416776 5692 64239 357257 3642 90262 458343 540 103960 388386 2099 106611 358934 567 103345 407560 2001 95551 392558 2949 82903 373177 2253 63593 428370 6533 126910 369419 1889 37527 358649 3055 60247 376641 272 112995 467427 1414 70184 364885 2564 130140 436230 1383 73221 329118 1261 76114 317365 975 90534 286849 3366 108479 376685 576 113761 407198 1686 68696 377772 746 71561 271483 3192 59831 153661 2045 97890 513294 5702 101481 324881 1932 72954 264512 936 67939 420968 3437 48022 129302 5131 86111 191521 2397 74020 268673 1389 57530 353179 1503 56364 354624 402 84990 363713 2239 88590 456657 2234 77200 211742 837 61262 338381 10579 110309 418530 875 67000 351483 1585 93099 372928 1659 107577 485538 2647 62920 279268 3294 75832 219060 0 60720 325560 94 60793 325314 422 57935 322046 0 60720 325560 34 60630 325599 1558 55637 377028 0 60720 325560 43 60887 323850 645 60720 325560 316 60505 331514 115 60945 325632 5 60720 325560 897 60720 325560 0 60720 325560 389 58990 322265 0 60720 325560 1002 56750 325906 36 60894 325985 460 63346 346145 309 56535 325898 0 60720 325560 9 60835 325356 271 60720 325560 14 61016 325930 520 58650 318020 1766 60438 326389 0 60720 325560 458 58625 302925 20 60938 325540 0 60720 325560 0 60720 325560 98 61490 326736 405 60845 340580 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 483 60830 331828 454 63261 323299 47 60720 325560 0 60720 325560 757 45689 387722 4655 60720 325560 0 60720 325560 0 60720 325560 36 61564 324598 0 60720 325560 203 61938 328726 0 60720 325560 126 60951 325043 400 60720 325560 71 60745 325806 0 60720 325560 0 60720 325560 972 71642 387732 531 71641 349729 2461 55792 332202 378 71873 305442 23 62555 329537 638 60370 327055 2300 64873 356245 149 62041 328451 226 65745 307062 0 60720 325560 275 59500 331345 0 60720 325560 141 61630 331824 0 60720 325560 28 60890 325685 0 60720 325560 4980 113521 404480 0 60720 325560 0 60720 325560 472 80045 318314 0 60720 325560 0 60720 325560 0 60720 325560 203 50804 311807 496 87390 337724 10 61656 326431 63 65688 327556 0 60720 325560 1136 48522 356850 265 60720 325560 0 60720 325560 0 60720 325560 267 57640 322741 474 61977 310902 534 62620 324295 0 60720 325560 15 60831 326156 397 60646 326960 0 60720 325560 1866 56225 333411 288 60510 297761 0 60720 325560 3 60698 325536 468 60720 325560 20 60805 325762 278 61404 327957 61 60720 325560 0 60720 325560 192 65276 318521 0 60720 325560 317 63915 319775 738 60720 325560 0 60720 325560 368 61686 332128 0 60720 325560 2 60743 325486 0 60720 325560 53 60349 325838 0 60720 325560 0 60720 325560 0 60720 325560 94 61360 331767 0 60720 325560 24 59818 324523 2332 72680 339995 0 60720 325560 0 60720 325560 131 61808 319582 0 60720 325560 0 60720 325560 206 53110 307245 0 60720 325560 167 64245 317967 622 73007 331488 2328 82732 335452 0 60720 325560 365 54820 334184 364 47705 313213 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 226 72835 348678 307 58856 328727 0 60720 325560 0 60720 325560 0 60720 325560 188 77655 387978 0 60720 325560 138 69817 336704 0 60720 325560 0 60720 325560 0 60720 325560 125 60798 322076 0 60720 325560 282 62452 334272 335 64175 338197 0 60720 325560 1324 67440 321024 176 68136 322145 0 60720 325560 0 60720 325560 249 56726 323351 0 60720 325560 333 70811 327748 0 60720 325560 601 60720 325560 30 62045 328157 0 60720 325560 249 54323 311594 0 60720 325560 165 62841 335962 453 81125 372426 0 60720 325560 53 59506 319844 382 59365 355822 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 30 60798 324047 290 58790 311464 0 60720 325560 0 60720 325560 366 61808 353417 2 60735 325590 0 60720 325560 209 64016 328576 384 54683 326126 0 60720 325560 0 60720 325560 365 87192 369376 0 60720 325560 49 64107 332013 3 60761 325871 133 65990 342165 32 59988 324967 368 61167 314832 1 60719 325557 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 22 60722 322649 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 96 60379 324598 1 60727 325567 314 60720 325560 844 60925 324005 0 60720 325560 26 60896 325748 125 59734 323385 304 62969 315409 0 60720 325560 0 60720 325560 0 60720 325560 621 60720 325560 0 60720 325560 119 59118 312275 0 60720 325560 0 60720 325560 1595 60720 325560 312 58598 320576 60 61124 325246 587 59595 332961 135 62065 323010 0 60720 325560 0 60720 325560 514 78780 345253 0 60720 325560 0 60720 325560 0 60720 325560 1 60722 325559 0 60720 325560 0 60720 325560 1763 61600 319634 180 59635 319951 0 60720 325560 0 60720 325560 0 60720 325560 0 60720 325560 218 60720 325560 0 60720 325560 448 59781 318519 227 76644 343222 174 64820 317234 0 60720 325560 0 60720 325560 121 56178 314025 607 60436 320249 2212 60720 325560 0 60720 325560 0 60720 325560 530 73433 349365 571 41477 289197 0 60720 325560 78 62700 329245 2489 67804 240869 131 59661 327182 923 58620 322876 72 60398 323117 572 58580 306351 397 62710 335137 450 59325 308271 622 60950 301731 694 68060 382409 3425 83620 279230 562 58456 298731 4917 52811 243650 1442 121173 532682 529 63870 319771 2126 21001 171493 1061 70415 347262 776 64230 343945 611 59190 311874 1526 69351 302211 592 64270 316708 1182 70694 333463 621 68005 344282 989 58930 319635 438 58320 301186 726 69980 300381 1303 69863 318765 7419 63255 286146 1164 57320 306844 3310 75230 307705 1920 79420 312448 965 73490 299715 3256 35250 373399 1135 62285 299446 1270 69206 325586 661 65920 291221 1013 69770 261173 2844 72683 255027 11528 -14545 -78375 6526 55830 -58143 2264 55174 227033 5109 67038 235098 3999 51252 21267 35624 157278 238675 9252 79510 197687 15236 77440 418341 18073 27284 -297706
Names of X columns:
costs dividends wealth
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